Skip to content

Commit 99e7c41

Browse files
authored
Clarification to command functions.
Added response send examples for interactions based off of options/choices.
1 parent 62148b9 commit 99e7c41

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

docs/gettingstarted.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ Now, we can finally visualize this by coding an example of this being used in th
161161
)
162162
])
163163
async def test(ctx, OptOne: str):
164-
pass
164+
await ctx.respond()
165+
await ctx.send(content=f"I got you, you said {OptOne}!")
165166
166167
Additionally, we could also declare the type of our command's option through this method shown here:
167168

@@ -220,13 +221,18 @@ a string or integer. Below is an implementation of this design in the Python cod
220221
choices=[
221222
create_choice(
222223
name="ChoiceOne",
223-
value="Hello command, this is my value!"
224+
value="DOGE!"
225+
),
226+
create_choice(
227+
name="ChoiceTwo",
228+
value="NO DOGE"
224229
)
225230
]
226231
)
227232
])
228233
async def test(ctx, OptOne: str):
229-
pass
234+
await ctx.respond()
235+
await ctx.send(content=f"Wow, you actually chose {OptOne}? :(")
230236
231237
.. _quickstart: https://discord-py-slash-command.readthedocs.io/en/latest/quickstart.html
232238
.. _ApplicationCommandOptionType: https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoptiontype

0 commit comments

Comments
 (0)