These instructions will get you a copy of the bot up and running on your environment for development and testing purposes. If you're looking for a cloud hosting solution, you can get a free $100 when you sign up for Digital Ocean with my referral code! A $5/mo droplet should be more than enough for a self-hosted version of TundraBot.
If you'd like to just use my bot on your server without setting anything up yourself, invite my bot to your Discord server here!
When installing Node.js, make sure you check the box to install Python and Visual Studio Build Tools:
If you are having trouble with installing npm packages, not having Python or Visual Studio Build Tools is likely the issue.
To check if you have Node.js installed, run this command in your terminal:
node -v
To install on Debian/Ubuntu, run this command in your terminal:
sudo apt-get install ffmpeg
To install on Windows:
- Download FFmpeg from here (latest version should work fine)
- Unzip the .zip file with a tool such as 7-Zip
- Save the resulting
ffmpeg
folder wherever you want to keep it - Add the absolute path of the
bin
folder within your newffmpeg
folder to your computer's environment variables
To check if you have FFmpeg installed, run this command in your terminal:
ffmpeg -version
Download or clone this repository with the command:
git clone https://github.com/joshuayuen99/TundraBot.git
Navigate to the newly created TundraBot
directory and type the following command:
npm install
You are likely to get a ton of errors that look fatal, however this won't affect the bot functioning at all—that's all for installing!
To start using the bot, you will first need to generate a Discord API token.
- Visit https://discord.com/developers/applications and log in to your Discord account.
- Click "New Application" at the top right and give it a name.
- Click the "Bot" tab on the left.
- Click the "Add Bot" button at the top right and give it a name.
- Where it says "Token", click the "Copy" button.
- Open up the
.env
file in yourTundraBot
directory and paste your token afterDISCORDTOKEN =
- Click the "OAuth2" tab on the left.
- Where it says "Client Secret", click the "Copy" button.
- In the
.env
file, paste your secret afterBOT_SECRET =
For the bot to function properly, you'll need to set up its MongoDB database. For TundraBot, I use the free tier of MongoDB Atlas.
- You'll want to visit https://www.mongodb.com/atlas/database and make an account.
- Create a new project.
- Under the "Atlas" tab, you'll want to create a new database. Take note of the name you give it.
- Under your new database, click the "Connect" button.
- When choosing your connection method, choose "Connect your application".
- Select "Node.js" as your driver and "4.0 or later" as your driver.
- In the
.env
file, you'll need to fill in theMONGOOSE
options with the appropriate fields:MONGOOSE_URL
: the URL following the@
up until the first/
, eg.cluster0.1abcd.mongodb.net
MONGOOSE_USERNAME
: the username of your MongoDB Atlas accountMONGOOSE_PASSWORD
: the password of your MongoDB Atlas accountMONGOOSE_DB
: the name of the database that you created previously
Only the Discord ID of the user specified in the .env
file will be able to run owner-only commands.
- Edit the
OWNERID
option in the.env
file to your own. - Optionally edit the
OWNERNAME
andOWNERTAG
options.
Once you've set up your Discord API key, you're ready to start the bot.
To build the bot, navigate to your TundraBot
directory and enter the command:
npm run build
To finally start the bot, enter the command:
npm run start
- Visit https://discord.com/developers/applications and log in to your Discord account.
- Click on your newly created project.
- Click the "OAuth2" tab on the left.
- Under "Scopes", check the "bot" and "applications.commands" boxes.
- Check all the permissions you want your bot to request upon joining a new server (the server owner will still have to agree to these upon the bot joining). The following are the bare minimum permissions the bot needs to function properly, but checking "Administrator" is a safe bet to make sure it has everything it needs.
You're done! All you need now is to copy the link at the bottom of the "Scopes" section and share that with any server owner that wants to use the bot.