我正在尝试从另一台服务器获取表情符号。我为服务器创建了一个服务器对象,它是一个常量,因为我只想从该服务器中提取数据。
for emoji in main_tuple:
emoji_name_id =await server.fetch_emoji(emoji)
emoji_array.append(f"<{emoji_name_id.name.lower()}:{emoji_name_id.id}>")
Run Code Online (Sandbox Code Playgroud)
错误:
nextcord.ext.commands.errors.CommandInvokeError:命令引发异常:NotFound:404 Not Found(错误代码:10014):未知表情符号
我应该提到我想在另一台服务器上显示它,我知道这可能是显而易见的,但是是的。main_tuple 是数据库中具有表情符号 ID 和名称的方向。错误
此外,机器人也是从中获取 ID 的服务器的一部分。我查看过:discord.py emoji 所有服务器机器人 ,它对我不起作用。
我有一个斜杠命令,但处理需要几秒钟。由于Discord响应交互的限制似乎是3秒,我在文档中找到了interaction.response.defer ()方法,这应该告诉Discord我已经收到了命令(不要抛出错误“交互没有响应” ”)
@client.slash_command(description="Test command", guild_ids=[123456789123456789])
async def test(interaction: nextcord.Interaction):
await interaction.response.defer()
await asyncio.sleep(10) # Doing stuff
await interaction.response.send_message("My actual content")
Run Code Online (Sandbox Code Playgroud)
但我收到这个错误:
nextcord.errors.InteractionResponded: This interaction has already been responded to before
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么 ?