Deployment - TheD4nM4n/admin GitHub Wiki
Deploying Admin
On this page, you will learn how to deploy Admin yourself, for full control over the bot. There is only one official way to deploy Admin, and that is through Docker.
Prerequisite: Setting up a bot user
- Go to Discord's Developer Console and sign in if you aren't already.
- Create a new application, and give it a name.
- Go to the Bot section of your application's settings.
- Click Add Bot, and click Yes, do it!.
NOTE: Discord will attempt to make a bot user with the same name as your application. If you get a Too many users have this username
error, you may have to change your application name to something else, then try again.
- (OPTIONAL) Change your bot user's name, if you would like to, as well as it's profile picture.
- Turn on Presence Intent and Server Members Intent. These are required!
- Go to the OAuth2 section of your application's settings.
- Click bot within the Scopes box.
- In the new Bot Permissions box below Scopes, check Administrator.
- Open the URL in the Scopes box in a new tab.
- In the dropdown titled Select a server, select the server you would like your bot to join, and click Continue.
- Complete the Captcha, if necessary.
- Go back to the Bot section of your application's settings.
- Click Copy under the Token section, and save this token for later.
WARNING: DO NOT SHARE THIS TOKEN WITH ANYONE! This token provides UNREISTRICTED ACCESS to your bot user and, since we gave your bot user administator privileges in the earlier steps, people with your token can abuse it to ban people, delete messages and channels, and more. Keep it safe. If the token does become compromised, you can use the Regenerate button beside the Copy button to void your old token and create a new one. You will need to create a new Admin container with the new token.
- Done! Follow the methods below to deploy Admin.
Method 1: Docker
- Install Docker from here.
- Test your docker install.
- In a terminal, as an Administrator (Windows) or as someone with root privileges (Linux/macOS), run the following command:
docker run hello-world
If this completes correctly, your Docker installation is ready for the next steps.
docker run
Using Starting an instance of Admin is very simple. In the same terminal you tested your Docker installation in, simply run the following command, replacing token with the token you saved earlier in this tutorial:
docker run -d -e TOKEN=token --name admin thed4nm4n/admin
Let's take a closer look at what this command is actually doing!
docker
: denotes what program we will be asking to do something (in this case, Docker).run
: tells Docker what it is going to do (run something).-d
: tells Docker to run the image in detached mode, which means it won't shut down if you close your terminal window.-e TOKEN=token
: this denotes an environment variable, a piece of information exposed to our program when it is ran. In this case, we are exposing the TOKEN variable to our program, with the value we set after the equals sign.--name admin
: this sets the name of the container that will be created by this command, for easy manipulation later.thed4nm4n/admin
: this tells Docker what image to run. to learn more about images, visit the Docker overview.