Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/358.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Discord.py表情符号对象错误,带有Discord';s默认的Unicode表情符号_Python_Python 3.x_Discord_Discord.py_Discord.py Rewrite - Fatal编程技术网

Python Discord.py表情符号对象错误,带有Discord';s默认的Unicode表情符号

Python Discord.py表情符号对象错误,带有Discord';s默认的Unicode表情符号,python,python-3.x,discord,discord.py,discord.py-rewrite,Python,Python 3.x,Discord,Discord.py,Discord.py Rewrite,我只是创建了一个命令,将/参数作为命令的输入 但discord.py似乎将自定义表情(不是discord中的默认表情)识别为表情符号/部分表情符号对象,但当我尝试从discord中为其指定默认Unicode表情符号时,它会给我一个 commands.UserInputError 这是我的代码: @client.command() async def massreact(ctx, limit: int, reaction : PartialEmoji): await ctx.message.del

我只是创建了一个命令,将/参数作为命令的输入

但discord.py似乎将自定义表情(不是discord中的默认表情)识别为表情符号/部分表情符号对象,但当我尝试从discord中为其指定默认Unicode表情符号时,它会给我一个 commands.UserInputError 这是我的代码:

@client.command()
async def massreact(ctx, limit: int, reaction : PartialEmoji):
await ctx.message.delete()
async for message in ctx.message.channel.history(limit=limit):
    await message.add_reaction(reaction)
例如,如果我这样做:

(前缀)5(自定义表情符号、gif或png)(有效)

但如果我这样做:


(前缀)5Change
async def massreact(ctx,limit:int,reaction:PartialEmoji):
到-


这应该行得通,如果不行,只要对这个答案发表评论,我很乐意提供帮助。

这很奇怪,为什么discord.py添加了这些对象,那么如果我们可以将表情符号作为字符串的话
async def massreact(ctx, limit: int, reaction : str):