#Message Command example
1 messages · Page 1 of 1 (latest)
basic_bot.py
An example to showcase the disnake.ext.commands extension module.
There are a number of utility commands being showcased here.
Use the buttons below to view on GitHub or in Discord.
thanks
no not this command
I meant the one where when you right click on a message it'll show commands
look at the example i linked
@disnake.ext.commands.message_command(*, name=None, dm_permission=None, default_member_permissions=None, nsfw=None, guild_ids=None, auto_sync=None, extras=None, **kwargs)```
A shortcut decorator that builds a message command.
I did
oh?
@disnake.ext.commands.command(name=..., cls=..., **attrs)```
A decorator that transforms a function into a [`Command`](https://docs.disnake.dev/en/latest/ext/commands/api.html#disnake.ext.commands.Command "disnake.ext.commands.Command") or if called with [`group()`](https://docs.disnake.dev/en/latest/ext/commands/api.html#disnake.ext.commands.group "disnake.ext.commands.group"), [`Group`](https://docs.disnake.dev/en/latest/ext/commands/api.html#disnake.ext.commands.Group "disnake.ext.commands.Group").
By default the `help` attribute is received automatically from the docstring of the function and is cleaned up with the use of `inspect.cleandoc`. If the docstring is `bytes`, then it is decoded into [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.11)") using utf-8 encoding.
All checks added using the [`check()`](https://docs.disnake.dev/en/latest/ext/commands/api.html#disnake.ext.commands.check "disnake.ext.commands.check") & co. decorators are added into the function. There is no way to supply your own checks through this decorator.
nah this is different
thats user_command/context menu im pretty sure
@disnake.ext.commands.user_command(*, name=None, dm_permission=None, default_member_permissions=None, nsfw=None, guild_ids=None, auto_sync=None, extras=None, **kwargs)```
A shortcut decorator that builds a user command.
user_commands are context command that are available when right-clicking > apps on a user,
message_commands are context commands when you right-click > apps on a message.
interactions/basic_context_menus.py
A simple example showing context menu commands.
User commands show up in the context menu (right-click/tap) of users,
while message commands show up in the context menu of messages.
Use the buttons below to view on GitHub or in Discord.