当我尝试运行此代码时。我收到以下有关动画表情符号的问题。 我是python的新手,需要帮助。
代码:
``` @commands.command()
async def help(self, ctx):
i=1
page1 = discord.Embed(title="page 1/2", description=f"This is the list of the command you can do, remember all of this is WIP(Work In Progress) also this bot run on discord.py package ver {discord.__version__}, have fun!", color=0x51C27D)
page1.set_author(name="help", icon_url="https://imgur.com/B7bT6PP.png")
page1.add_field(name="Fun", value="rs, bird, dog, cat",inline=False)
page1.add_field(name="Unitity", value="info, uptime, whois", inline=False)
page1.add_field(name="?Moderation?", value="warn", inline=False)
page2 = discord.Embed(title='test')
q=await ctx.send(embed=page1)
await q.add_reaction("⬅️")
await q.add_reaction("➡️")
emoji=''
while True:
if emoji=='⬅️':
i=1
await q.edit(embed=page[i])
if emoji=='➡️':
i=2
await q.edit(embed=page[i])```
错误:
Task exception was never retrieved
future: <Task finished coro=<Client.run.<locals>.runner() done, defined at /data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/site-packages/discord/client.py:545> exception=KeyError('animated')>
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/site-packages/discord/client.py", line 547, in runner
await self.start(*args, **kwargs)
File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/site-packages/discord/client.py", line 511, in start
await self.connect(reconnect=reconnect)
File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/site-packages/discord/client.py", line 433, in connect
await self._connect()
File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/site-packages/discord/client.py", line 397, in _connect
await self.ws.poll_event()
File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/site-packages/discord/gateway.py", line 470, in poll_event
await self.received_message(msg)
File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/site-packages/discord/gateway.py", line 424, in received_message
func(data)
File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/site-packages/discord/state.py", line 410, in parse_message_reaction_add
emoji = PartialEmoji.with_state(self, animated=emoji_data['animated'], id=emoji_id, name=emoji_data['name'])
KeyError: 'animated'
谢谢, 埃里克
答案 0 :(得分:0)