我的命令有问题,由于某种原因,该命令昨晚起作用,但现在仅当我提及自己的用户名时,该命令才起作用。我可以正确使用user=message.mentions[0]
吗?
@client.async_event
async def on_message(message):
if message.author == client.user:
return
elif message.content.startswith('!punch'):
user = message.mentions[0]
responses = ['DANG ' + user.mention + ' just got punched!', 'LOOK OUT ' + user.mention + ' just got knocked out! ლ(ಠ益ಠლ)', 'trong uppercut right in ' + user.mention + 's chin']
choice = random.choice(responses)
await client.send_message(message.channel, choice)