我他妈的什么都试过了,我不能让它工作。当我编写命令时,我希望bot用一个复选标记对嵌入做出反应,但是通过我所做的一切,我得到了这个字符串错误。我现在已经试了两个小时,但没有成功。请帮帮我。我正在使用discord.py
@client.command()
async def verification(ctx):
verifyEmbed = discord.Embed(
title="VERIFY",
description="To get access to the server you need to verify. \nVerify by reacting with :white_check_mark: \n\n ",
color=discord.Colour.green()
)
embedMsg = await ctx.send(embed=verifyEmbed)
checkM = client.get_emoji("✅")
await embedMsg.add_reaction(checkM)
错误消息:
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: InvalidArgument: emoji argument must be str, Emoji, or Reaction not NoneType.
get_emoji用于按ID获取表情符号,因此它返回
None
,这导致您在add_reaction
中出错您可以直接将check emoji放入add_reaction,但我建议使用unicode表示法添加reaction:
相关问题 更多 >
编程相关推荐