我要这样做,以便在删除邮件时发送在#logs中删除的邮件
代码:
@bot.event
async def on_message_delete(message):
data = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
print("[" + (colored("{}".format(data), 'white')) + "][" +
(colored("{}".format(message.server), 'blue')) + " - " +
(colored("{}".format(message.channel), 'magenta')) + "] " +
(colored("{}".format(message.author), 'cyan', 'on_magenta') +
(colored(": {}".format(message.content), 'red'))))
channel = bot.get_channel("logs")
await bot.say(channel, "ALERT: Message Deleted")
await bot.say(channel, "Message {} got deleted by {} in {}".format(message.content, message.author, channel))
await bot.process_commands(message)