Skip to content

Commit d850ed4

Browse files
authored
Change ctx.send to ctx.respond in the examples (#182)
* Change `ctx.send` to `ctx.respond` * Change `ctx.send` to `ctx.respond`
1 parent a4e816a commit d850ed4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/app_commands/slash_basic.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@
1313
@bot.slash_command(guild_ids=[...]) # create a slash command for the supplied guilds
1414
async def hello(ctx):
1515
"""Say hello to the bot""" # the command description can be supplied as the docstring
16-
await ctx.send(f"Hello {ctx.author}!")
16+
await ctx.respond(f"Hello {ctx.author}!")
1717

1818

1919
@bot.slash_command(
2020
name="hi"
2121
) # Not passing in guild_ids creates a global slash command (might take an hour to register)
2222
async def global_command(ctx, num: int): # Takes one integer parameter
23-
await ctx.send(f"This is a global command, {num}!")
23+
await ctx.respond(f"This is a global command, {num}!")
2424

2525

2626
@bot.slash_command(guild_ids=[...])
2727
async def joined(
2828
ctx, member: discord.Member = None
2929
): # Passing a default value makes the argument optional
3030
user = member or ctx.author
31-
await ctx.send(f"{user.name} joined at {discord.utils.format_dt(user.joined_at)}")
31+
await ctx.respond(f"{user.name} joined at {discord.utils.format_dt(user.joined_at)}")
3232

3333

34-
# To learn how to add descriptions, choices to options check slash_options.py
34+
# To learn how to add descriptions and choices to options, check slash_options.py
3535
bot.run("TOKEN")

examples/app_commands/slash_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ async def hello(
1414
gender: Option(str, "Choose your gender", choices=["Male", "Female", "Other"]),
1515
age: Option(int, "Enter your age", required=False, default=18),
1616
):
17-
await ctx.send(f"Hello {name}")
17+
await ctx.respond(f"Hello {name}")
1818

1919
bot.run('TOKEN')

0 commit comments

Comments
 (0)