Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added type hinting in code examples #451

Merged
merged 6 commits into from
Apr 20, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/getting-started/creating-your-first-bot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async def on_ready():
print(f"{bot.user} is ready and online!")

@bot.slash_command(name = "hello", description = "Say hello to the bot")
async def hello(ctx):
async def hello(ctx: discord.ApplicationContext):
await ctx.respond("Hey!")

bot.run(os.getenv('TOKEN')) # run the bot with the token
Expand Down Expand Up @@ -191,7 +191,7 @@ event that is automatically called when the bot is ready to use.

```py
@bot.slash_command(name = "hello", description = "Say hello to the bot")
async def say_hello(ctx):
async def say_hello(ctx: discord.ApplicationContext):
Yellow-Beans marked this conversation as resolved.
Show resolved Hide resolved
await ctx.respond("Hey!")
```

Expand Down Expand Up @@ -224,7 +224,7 @@ async def on_ready():
print(f"{bot.user} is ready and online!")

@bot.slash_command(name = "hello", description = "Say hello to the bot")
async def hello(ctx):
async def hello(ctx: discord.ApplicationContext):
await ctx.send("Hey!")

bot.run("TOKEN")
Expand Down