discord.py-按名称在特定频道上发送消息

时间:2018-09-07 13:36:34

标签: python discord.py

我要这样做,以便在删除邮件时发送在#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)

0 个答案:

没有答案