Answer the question
In order to leave comments, you need to log in
How to make the bot accept a message from the user and send it on its own behalf?
Hello, how can I make the bot receive messages in the discord chat and immediately delete and send on my behalf.
The user will write briefly in the chat, but the bot will delete this message and send it on its own behalf, so that the chat participants do not see who wrote this message.
Answer the question
In order to leave comments, you need to log in
The bot accepts the command say!
Usage: [prefix]say [message]
CODE:
@client.command()
@commands.has_permissions(view_audit_log = True) #права команды: Просматривать аудит логи
async def say(ctx, *, arg = None):
emb = discord.Embed(description = f'{arg}', color = 0x0944d9) #цвет синий
await ctx.send(embed = emb) #отправка сообщения
@say.error #если у участника нету прав просматривать аудит лог то пишем ему то что у вас не достаточно прав!
async def say_error(ctx, error):
if isinstance(error, commands.MissingPermissions):
emb = discord.Embed(titile = f'Ошибка', description = f'**У вас недостаточно прав!**', color = RED)
emb.set_footer(text = f'{client.user.name} © 2020 | Все права защищены', icon_url = client.user.avatar_url)
await ctx.send(embed = emb, delete_after = 15)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question