我试着在我的机器人上做斜杠命令。然而,当我运行机器人时,斜杠命令不会出现,我也尝试过重新邀请机器人。这里是我目前的代码
@client.slash_command(name="ping", description="Check bots ping!")
async def pingtest(interaction : Interaction):
await interaction.response.send_message(f"My ping is {round(client.latency * 1000)}ms")是的,我确实有正确的导入,因为我知道您需要特殊的导入来执行斜杠命令,而且我有最新版本的nextcord。
发布于 2022-05-14 16:27:05
这里可能有几个问题。
serverID = serverIDYouAreTestingOnAsAnIntegerValue
@client.slash_command(name="ping", description="Check bots ping!", guild_ids=serverID)
async def pingtest(interaction : Interaction):
await interaction.response.send_message(f"My ping is {round(client.latency * 1000)}ms")permissions.
https://stackoverflow.com/questions/71253994
复制相似问题