Answer the question
In order to leave comments, you need to log in
How can I send a message when a command is executed, and send another message if the command fails?
We need code on the discord.py library, which will send messages depending on the execution / non-execution of the command.
For example, yes.
We have a code for banning a user on the server:
@bot.command(pass_contex=True)
@commands.has_permissions(administrator=True)
async def ban(ctx,member:discord.Member,*,reason=None):
await member.ban(reason=reason)
Answer the question
In order to leave comments, you need to log in
The command is being executed - message about successful execution.
@command(...)
...
async def cmd(ctx, *args):
"""Описание команды"""
# делаем что-нибудь
await ctx.send("Сделано!")
The command is not executed - a message about not executing.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question