Answer the question
In order to leave comments, you need to log in
How to make event work on one server?
Good afternoon. Suppose I have such an event
@client.event
async def on_message_delete(message):
channel = client.get_channel(703596630892478506)
if message.content is None:
return;
embed = discord.Embed(color = random.choice(colors), description=f"{message.author.mention} `Удалил сообщение в канале` {message.channel.mention} \n \n**Удаленное сообщение** - {message.content}",timestamp=message.created_at)
embed.set_author(name=f"{message.author}", icon_url=f'{message.author.avatar_url}')
embed.set_footer(text=f'ID Пользователя: {message.author.id} | ID Сообщения: {message.id}')
await channel.send(embed=embed)
return
Answer the question
In order to leave comments, you need to log in
so you want to make the command universal for all servers, did I understand correctly?
what for to you then a line ?
remove it and replace it withchannel = client.get_channel(703596630892478506)
await channel.send(embed=embed)
await nessage.channel.send(embed=embed)
Get the server from the message object: discord.Message.guild
if message.guild.id != 282480459897027773:
return
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question