我正在使用datetime
确定发送消息的时间。
冻结日期的照片:
代码:
from datetime import datetime
date = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
@bot.event
async def on_message(message):
if message.author.bot == False:
print("[" + (colored("{}".format(date), 'white')) + "][" + (colored("{}".format(message.server), 'blue')) + " - " + (colored("{}".format(message.channel), 'magenta')) + "] " + (colored("{}".format(message.author), 'cyan') + ": " + message.content))