Discord.py如何判断玩家是否发送了任何类型的消息

时间:2018-06-13 23:54:17

标签: python-3.x discord.py

我想创建一个exp系统,为此,我需要查看用户是否发送了任何消息,那么,我如何在discord.py中检查它?

1 个答案:

答案 0 :(得分:0)

根据documentation,您可以执行以下操作:

@client.event
async def on_message(msg):
    print("{} user has sent a message in {}".format(msg.author.name,msg.channel.name))
    #whatever you want to do with the XP system