mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-11 04:17:58 +00:00
[commands] Fix broken examples in commands.param documentation
This commit is contained in:
parent
40176bb71b
commit
d319539edb
@ -913,7 +913,7 @@ This is useful for:
|
|||||||
.. code-block:: python3
|
.. code-block:: python3
|
||||||
|
|
||||||
@bot.command()
|
@bot.command()
|
||||||
async def wave(to: discord.User = commands.parameter(default=lambda ctx: ctx.author)):
|
async def wave(ctx, to: discord.User = commands.parameter(default=lambda ctx: ctx.author)):
|
||||||
await ctx.send(f'Hello {to.mention} :wave:')
|
await ctx.send(f'Hello {to.mention} :wave:')
|
||||||
|
|
||||||
Because this is such a common use-case, the library provides :obj:`~.ext.commands.Author`, :obj:`~.ext.commands.CurrentChannel` and
|
Because this is such a common use-case, the library provides :obj:`~.ext.commands.Author`, :obj:`~.ext.commands.CurrentChannel` and
|
||||||
@ -922,7 +922,7 @@ This is useful for:
|
|||||||
.. code-block:: python3
|
.. code-block:: python3
|
||||||
|
|
||||||
@bot.command()
|
@bot.command()
|
||||||
async def wave(to: discord.User = commands.Author):
|
async def wave(ctx, to: discord.User = commands.Author):
|
||||||
await ctx.send(f'Hello {to.mention} :wave:')
|
await ctx.send(f'Hello {to.mention} :wave:')
|
||||||
|
|
||||||
:obj:`~.ext.commands.Author` and co also have other benefits like having the displayed default being filled.
|
:obj:`~.ext.commands.Author` and co also have other benefits like having the displayed default being filled.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user