为何相同Discord Embed编辑代码一处正常一处报50035错误?
Among Us Discord 机器人开发报错求助
- 开发场景:正在开发用于《Among Us》对局功能的Discord机器人
- 异常表现:执行Embed消息编辑操作时,某一处的编辑逻辑运行完全正常,将完全相同的代码复制到另一处执行相同操作时,会抛出如下错误:
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body - 对应触发报错的代码:
if emoji == '✅': #Add User to lobby members list if user in LOBBY_MEMBERS: consoleMessage = str(user) + ' is already in the lobby.' else: LOBBY_MEMBERS.append(user) consoleMessage = str(user) + ' has joined the lobby.' updated_embed=discord.Embed(title="Among Us Lobby", description="Welcome to the among us bot!", color=0x00ff1e) ################Error does not show up here:########################## await reaction.message.edit(embed=updated_embed) if emoji == '❌': if user in LOBBY_MEMBERS: LOBBY_MEMBERS.remove(user) consoleMessage = str(user) + ' has left the lobby.' updated_embed=discord.Embed(title="Among Us Lobby", description="Welcome to the among us bot!", color=0x00ff1e) ################Error shows up here:########################## await reaction.message.edit(embed=updated_embed) else: consoleMessage = str(user) + ' is not in the lobby. Cannot remove someone who has not joined.'
- 提问者身份:Python开发新手
- 核心疑问:不清楚为什么完全相同的代码可以在一处正常运行,在另一处却抛出上述错误。
内容的提问来源于stack exchange,提问作者2020 Gamer
相关产品推荐
相关产品推荐

