#Message Command example

1 messages · Page 1 of 1 (latest)

wispy onyx
#

Any disnake.ext.commands.message_command example?

potent shuttleBOT
#
basic_bot.py

An example to showcase the disnake.ext.commands extension module.

There are a number of utility commands being showcased here.

mild saffron
#

there u go

#

its also not .message_command

wispy onyx
#

thanks

#

no not this command

#

I meant the one where when you right click on a message it'll show commands

wispy onyx
#

hold on

mild saffron
#

look at the example i linked

vivid juncoBOT
#

@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.
wispy onyx
mild saffron
#

oh?

vivid juncoBOT
#

@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.
wispy onyx
wispy onyx
#

like this

mild saffron
#

thats user_command/context menu im pretty sure

vivid juncoBOT
#

@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.
floral patrol
#

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.

potent shuttleBOT
#
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.

mild saffron
#

wait

#

lmao

#

message cmds