标题。这是我当前的代码:
@client.event
async def on_message(message):
emoji = client.get_emoji(765173945056886814)
if message.author.id == 236199051505303552:
await message.add_reaction(emoji)
我得到的错误是
line 1082, in _emoji_reaction
raise InvalidArgument('emoji argument must be str, Emoji, or Reaction not {.__class__.__name__}.'.format(emoji))
discord.errors.InvalidArgument: emoji argument must be str, Emoji, or Reaction not NoneType.
We have logged in as Zinthium#3381
The program 'python.exe' has exited with code -1 (0xffffffff).
答案 0 :(得分:0)
自行获取表情符号代码。通过键入\emoji
。 \
基本上是不和谐的转义字符。表情符号代码如下<:klol:716218157060325387>
@client.event
async def on_message(message):
if message.author.id == 236199051505303552:
await message.add_reaction("emoji code")
您的代码应该可以正常工作。我认为该机器人无法访问该表情符号。也许它不在服务器中。因此它返回None
答案 1 :(得分:0)
此
emoji = ':woo:765172185995411456'
似乎有效,我只需要标记将要使用的表情符号,例如emoji1,emoji2等或emojiWoo。