- Open User Settings and, under Developer, click Developers.
- Click New Application, choose a name between 2 and 32 characters and confirm.
- Copy the bot token right away: it's only shown once. If you lose it, reset the token.
- In the OAuth2 tab, check the bot's permissions, copy the generated link and open it to choose the server.
Heads upThe token is like a password. Never share it or put it in public code.
To add a bot to a server you need to be the server owner or have the Manage Server permission. Private bots can only be added by the application's owner.
Docs: Getting started for developers