Create a Discord Bot Token
Create a Discord bot, copy its token and invite it to your server so an STG Scripts resource can read roles and members.
Some STG scripts talk to your Discord server through a bot, for example to check roles. For that, the script needs a bot token.
Create the bot
Open the Developer Portal
Go to the Discord Developer Portal and sign in with your Discord account.
Create an application
Click New Application, give it a name, for example your server's name, accept the terms and click Create.
Get the token
Open the Bot page from the left menu, click Reset Token, confirm, and copy the token that appears.
Discord shows the token only once. If you lose it, click Reset Token again to create a new one.
Enable intents if needed
Still on the Bot page, turn on Server Members Intent under Privileged Gateway Intents if the script's Configuration page asks for it, then save.
Invite the bot to your server
The bot can only see roles on a server it has joined.
Open OAuth2, then URL Generator, and tick the bot scope.
Copy the generated URL at the bottom of the page and open it in your browser.
Choose your server and click Authorize.
Add it to the script
Paste the token into the script's config and restart the resource. The setting name can differ between scripts, so check the Configuration page of the script you are setting up.
Never share your bot token, not even in a support ticket. Anyone with it can control the bot. If it leaks, click Reset Token right away.
Still having trouble?
Open a ticket on our Discord. Our team answers around 15 hours a day.