简体   繁体   English

Python discord bot perms

[英]Python discord bot perms

Im having another issue with my bot.我的机器人还有另一个问题。 I own the bot and the server, everytime i try to kick or ban i get this error我拥有机器人和服务器,每次我尝试踢或禁止我都会收到此错误

./discordbot.py 
Bot is online
Ignoring exception in command kick:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/discord/ext/commands/core.py", line 79, in wrapped
    ret = await coro(*args, **kwargs)
  File "./discordbot.py", line 25, in kick
    await member.kick(reason=reason)
  File "/usr/local/lib/python3.7/dist-packages/discord/member.py", line 464, in kick
    await self.guild.kick(self, reason=reason)
  File "/usr/local/lib/python3.7/dist-packages/discord/guild.py", line 1569, in kick
    await self._state.http.kick(user.id, self.id, reason=reason)
  File "/usr/local/lib/python3.7/dist-packages/discord/http.py", line 218, in request
    raise Forbidden(r, data)
discord.errors.Forbidden: 403 FORBIDDEN (error code: 50013): Missing Permissions

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/discord/ext/commands/bot.py", line 863, in invoke
    await ctx.command.invoke(ctx)
  File "/usr/local/lib/python3.7/dist-packages/discord/ext/commands/core.py", line 728, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/usr/local/lib/python3.7/dist-packages/discord/ext/commands/core.py", line 88, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: Forbidden: 403 FORBIDDEN (error code: 50013): Missing Permissions

dose anyone know why?有人知道为什么吗?

You didn't give permissions to your bot to kick or ban that's why it is doing that to give permissions go to https://discordapp.com/developers/applications now click on bot you were editing click on OAuth2.你没有给你的机器人给权限踢或禁止这就是为什么它是这样做给权限去https://discordapp.com/developers/applications现在点击你的OAuth2用户编辑点击机器人。 under scopes click "bot" now give it the kick/ban permissions.在范围下单击“bot”现在给它踢/禁止权限。 add it in your server using the link given in the scopes now it will work just fine.i had the same problem i fixed it that way if you still can't solve it msg me then.使用范围中给出的链接将其添加到您的服务器中,现在它可以正常工作了。我遇到了同样的问题,如果您仍然无法解决它,请给我留言。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM