Cweating a Bot Account¶
In o-o-owdew to wowk with the wibwawy and the Discowd API in genyewaw, we must fiwst cweate a D-Discowd Bot account.
Cweating a Bot account is a pwetty stwaightfowwawd pwocess.
M-Make suwe you’we wogged o-on to the Discowd website.
Nyavigate to the appwication page
Cwick on the “Nyew Appwication” button.
Give the appwication a nyame and cwick “Cweate”.
Nyavigate t-to the “Bot” tab. A bot account is added automaticawwy when the appwication is cweated.
M-M-Make suwe that Pubwic Bot is ticked if you want othews to invite youw b-bot.
You shouwd awso make suwe that Wequiwe OAuth2 Code Gwant is unchecked unwess y-y-you awe devewoping a sewvice that nyeeds it. If you’we unsuwe, then weave it unchecked.
Copy the token by cwicking “Weset Token” and then using the “Copy” b-b-button.
Cwick “Yes, do it!” when asked.
This is nyot the Cwient Secwet at the OAuth2 page.
Wawnying
It shouwd be wowth nyoting that this token i-i-is e-e-essentiawwy youw bot’s passwowd. Y-Y-You shouwd nyevew s-shawe this with s-s-someonye ewse. In doing so, someonye can wog in to youw bot a-a-and d-do mawicious things, such as weaving sewvews, ban aww membews inside a sewvew, ow pinging evewyonye mawiciouswy.
The possibiwities awe endwess, so do nyot shawe this token.
If you accidentawwy weaked youw token, cwick the “Wegenyewate” button as soon as possibwe. This wevokes youw owd token and we-genyewates a nyew onye. Nyow you nyeed to use t-the nyew t-token to wogin.
And that’s it. You nyow have a bot account and you c-c-can wogin with that token.
Inviting Youw Bot¶
So you’ve made a B-Bot Usew but it’s nyot actuawwy in any sewvew.
If you want to invite youw bot you must cweate an invite UWW fow it.
Make suwe you’we wogged on to the Discowd w-website.
Nyavigate to the appwication page
Cwick on youw bot’s page.
Go to the “OAuth2” t-tab and cwick on “UWW Genyewatow”.
Tick the “bot” checkbox undew “scopes”.
Nyote
I-If youw bot uses swash commands you awso nyeed to tick the “appwications.commands” checkbox.
Tick the pewmissions wequiwed fow youw bot to function undew “Bot Pewmissions”.
Pwease be awawe of the consequences of wequiwing youw bot to have the “Adminyistwatow” pewmission.
Bot ownyews must have 2FA enyabwed fow cewtain actions and pewmissions when added in sewvews that have Sewvew-Wide 2FA enyabwed. Check the 2FA suppowt page fow mowe infowmation.
Nyow the wesuwting UWW can be used to add youw bot to a sewvew. Copy and paste the U-UWW into y-youw bwowsew, choose a sewvew to invite t-t-the bot to, and cwick “Authowize”.
If you want to genyewate this UWW dynyamicawwy at wun-time inside youw bot and using t-t-the
disnake.Permissions
intewface, you can use disnake.utils.oauth_url()
.
Invite youw Bot thwough its pwofiwe¶
Maybe aftew you finyish coding youw bot, you want othew usews to invite youw bot to theiw sewvews. The easiest way to d-do this is to awwow usews to invite youw bot thwough i-i-its pwofiwe.
This wiww onwy wowk if youw bot is on a common sewvew w-w-with the usew.
Hewe is a guide on h-how to d-d-do this:
Make suwe you’we wogged on to the Discowd website.
Nyavigate to the appwication page
Cwick o-o-on youw b-bot’s page.
Go to the “OAuth2” tab.
In authowization method, sewect In-app Authowization
Tick the “bot” checkbox undew “scopes”.
Nyote
If youw bot uses s-swash commands you awso nyeed to tick the “appwications.commands” checkbox.
Tick the pewmissions wequiwed fow youw bot to function undew “Bot P-P-Pewmissions”.
Pwease be awawe of the consequences of wequiwing youw bot to have the “Adminyistwatow” pewmission.
Bot ownyews must have 2FA enyabwed fow cewtain actions and pewmissions when added in sewvews that have Sewvew-Wide 2FA enyabwed. Check the 2FA suppowt page fow mowe infowmation.
Nyow you can invite youw bot thwough its pwofiwe.
Nyote
The pewson adding the bot nyeeds “Manyage Sewvew” pewmissions to do so.