简体   繁体   English

如何为 Discord Bot 创建角色

[英]How to create a role for a Discord Bot

I am using discord.py to create my bot and I was wondering how to create roles/permissions specific to the bot?我正在使用 discord.py 创建我的机器人,我想知道如何创建特定于机器人的角色/权限?

What that means is when the bot enters the server for the first time, it has predefined permissions and role set in place so the admin of the server doesn't need to set a role and permissions for the bot.这意味着当机器人第一次进入服务器时,它具有预定义的权限和角色设置,因此服务器管理员不需要为机器人设置角色和权限。

I have been trying to look up a reference implementation of this but no luck.我一直在尝试查找这个的参考实现,但没有运气。 If someone can point me at example of how to get a simple permission/role for a bot that will be great!如果有人可以指出我如何为机器人获得简单许可/角色的示例,那就太好了!

您想使用 url 参数通过 oath2 执行此操作

Bot will create it's own role when it joins the server through the invite. Bot 会在通过邀请加入服务器时创建自己的角色。 You can set the bot's role permissions in OAuth2.您可以在 OAuth2 中设置机器人的角色权限。 Just click this link and select your application.只需单击此链接并选择您的应用程序。 Then go to OAuth2 (or create a bot if u didn't) and select all permissions which your bot's role will have.然后转到 OAuth2(如果没有,则创建一个机器人)并选择您的机器人角色将拥有的所有权限。 Then copy the URL (which will be your bot's invite).然后复制 URL(这将是您的机器人的邀请)。 Invite your bot.邀请您的机器人。 Done!完毕!

you want to do this through oath2 using the url parameters您想使用 url 参数通过 oath2 执行此操作

As Astrydax said, the bot will automatically create its own role upon invite, and you can invite you bot here: Discord Developers正如Astrydax所说,机器人会在收到邀请后自动创建自己的角色,您可以在此处邀请您的机器人: Discord Developers

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

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