[英]Discord.py if statement emoji not continuing
So I have a problem, where I have my if statement, which should absolutely work but it does not.所以我有一个问题,我有我的 if 语句,它应该绝对有效,但它没有。
Here is the code:这是代码:
@client.event
async def on_raw_reaction_add(payload):
if payload.channel_id == xxxx:
print(payload.emoji)
if payload.emoji == "🆗":
print('test')
So this should work because payload.emoji returns this:所以这应该有效,因为 payload.emoji 返回这个:
🆗
How could I fix this issue?我该如何解决这个问题?
Okay, so I have just found the error.好的,所以我刚刚发现了错误。
You have to write payload.emoji.name
not payload.emoji
.你必须写
payload.emoji.name
而不是payload.emoji
。
That's all.就这样。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.