Bot#

Important

This guide assumes you have checked out the Quickstart guide

In v1.3 the bot class was added, along with permissions class and the permissions argument to the AuthUrl class, allowing for bot auth url’s to be made and used to invite a bot to a guild.

Now the first thing we need to do is add the bot and permissions classes, and save the client id to a variable

bot.py#
1from DisOAuth import bot, permissions
2
3clientID = {The client id of your bot}

Now we can set up the permissions

Permissions#

Depending on what you want your bot to do, you will need to use certain permissions, to learn what each permission does (and if there is a permission group you can use) check out the API documentation and the Permissions documentation

To make this easier to understand, I will be using the Advanced permission group, or just administrator

bot.py#
4perms = permissions("administrator")

Now we have some basic permissions

Warning

Using administrator as your permissions during testing is ok, but you should definitely specify only the permissions you need for your bot to work

This is because if your bot gets hacked, you don’t want the servers of the people who use your bot to get nuked or scammed.

Time to set up the bot url!

Bot Auth#

To make the bot url we can use the brand new bot class or the AuthUrl class. For this part of the guide, we will use the Bot class

To get it to work you will need to put in the client id and permissions class you set up earlier, and use the url() method

bot.py#
5url = await bot(clientID, perms).url()

And url will be your bot url

bot.py#
1from DisOAuth import bot, permissions
2
3clientID = {The client id of your bot}
4perms = permissions("administrator")
5url = await bot(clientID, perms).url()

To use AuthUrl instead of bot to combine the app and bot auth, all you need to do is change the bot class to AuthUrl, and add the needed arguments