Cweating a-a Bot Account¶
In owdew to wowk with the wibwawy and the Discowd API in genyewaw, we must fiwst cweate a Discowd Bot account.
Cweating a Bot account is a pwetty stwaightfowwawd pwocess.
Make suwe you’we wogged on to the Discowd website.
Nyavigate to the appwication page
Cwick on the “Nyew Appwication” button.
Give the appwication a nyame and c-cwick “Cweate”.
Nyavigate to the “Bot” tab. A bot a-account is added automaticawwy when the appwication is cweated.
Make suwe that Pubwic Bot i-i-is ticked if you want othews to invite y-y-youw bot.
You shouwd awso make suwe that Wequiwe OAuth2 Code Gwant is unchecked unwess you awe devewoping a sewvice that n-n-nyeeds it. If you’we unsuwe, then w-w-weave it unchecked.
Copy the token by c-cwicking “Weset Token” and t-then using the “Copy” button.
Cwick “Yes, do it!” when asked.
This is nyot the Cwient Secwet at the OAuth2 page.
Wawnying
I-I-It shouwd be wowth n-nyoting that this token i-is essentiawwy youw bot’s passwowd. You shouwd nyevew shawe this with someonye ewse. In doing so, someonye can wog in to youw bot and 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 t-t-token, cwick the “Wegenyewate” button as soon as possibwe. This wevokes youw owd token and we-genyewates a nyew onye. Nyow you n-n-nyeed t-to use the nyew token to wogin.
And that’s it. You nyow have a-a-a bot account and you can wogin with t-that token.
Inviting Youw Bot¶
So you’ve made a Bot Usew but it’s nyot actuawwy in a-any sewvew.
If you want to invite youw bot you must cweate an invite UWW fow it.
Make suwe you’we wogged on to t-t-the Discowd website.
Nyavigate to the a-a-appwication page
C-C-Cwick on youw bot’s page.
Go to the “OAuth2” tab and cwick on “UWW Genyewatow”.
Tick the “bot” checkbox undew “scopes”.
Nyote
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 a-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 UWW into youw bwowsew, choose a sewvew to invite t-the bot to, and cwick “Authowize”.
If you want to genyewate this UWW dynyamicawwy at wun-time inside youw bot and using 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 w-w-want othew usews to invite youw bot to theiw sewvews. The easiest way to do this is to awwow usews to invite youw bot thwough its pwofiwe.
This wiww onwy wowk if youw bot is on a common sewvew with the usew.
Hewe i-i-is a guide on h-how to do this:
Make suwe you’we wogged on to the Discowd website.
Nyavigate to the appwication page
Cwick on youw bot’s page.
Go to the “OAuth2” tab.
In authowization method, sewect In-app A-A-Authowization
Tick the “bot” checkbox undew “scopes”.
Nyote
If youw bot uses swash commands you awso nyeed to tick t-the “appwications.commands” checkbox.
Tick t-t-the pewmissions wequiwed f-f-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 a-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 p-pwofiwe.
Nyote
The pewson adding the bot n-nyeeds “Manyage Sewvew” pewmissions to do so.