我开始收到警告(启动机器人时):
disnake\ext\commands\interaction_bot_base.py:733: SyncWarning: Failed to overwrite commands in <Guild id=889176263992963142> due to 403 Forbidden (error code: 50001): Missing Access
warnings.warn(尝试定位它,但是这个错误应该发生在is (最后一个):
async def _sync_application_command_permissions(self) -> None:
# Assuming that permissions and commands are cached
if not isinstance(self, disnake.Client):
raise NotImplementedError(f"This method is only usable in disnake.Client subclasses")我发出的警告是完整的信息。我也尝试了几个版本,当我确信它没有产生这个警告,但它现在开始出现。
该机器人被邀请,包括applications.commands范围。
使用的库是disnake,如果有人可以为它创建一个特定的标记,那就太好了。
发布于 2022-02-28 21:59:50
问题是,试图在不在场的情况下访问test_guild (我已经将机器人从两个公会中的一个踢了出来)。
bot = commands.Bot(
command_prefix=commands.when_mentioned_or("!"),
test_guilds=[guild_id1, guild_id2],
intents=disnake.Intents.all()
)取消这个额外的公会解决了这个问题。
https://stackoverflow.com/questions/71301525
复制相似问题