Setting up the bot yourself

Here's what you need to do to run the bot yourself.

Please note that this tutorial is for running the bot on Windows

1. Downloading

1.1 Install all the needed software

You will need:

  • A Code editor (like VS Code)

  • NodeJS and NPM (I have Node 10.16.3, use LTS)

Simply install the software using the executables

1.2 Download the GitHub repo

If you want the stable version of the bot, download the latest release of the source code.

If you want the latest code avalible, simply go to the GitHub page and click the "Clone or Download" and click "Download ZIP"

Buttons on the page

When you download the code, unzip it into some foled you want to work from and move to the next step.

2. Preparing the environment

2.1 Install the required NPM packages

When you unzip the folder you will be left with this:

First thing you want to do is to open a console window by Shift+right-clicking on empty space in the folder and then clicking on the "Open console here" or "Open PowerShell here".

And if you would try to run the bot using node index.js in console, then you would get this:

So you need to install the modules first by typing the command npm install which will automatically install the required packages, that are located in package.json and package-lock.json

After it's done you can start editing the bot

3. Configure the bot

3.1 Bot Token

Bot token is the large string you get from Discord so you can login to your bot

Because my bot is currently running on Heroku, you have to change some keys in some files like for example in index.js the last line, which is used to connect the bot with discord using the token, there is bot.login(process.env.BOT_TKN); //process.env.BOT_TKN is for heroku, change it to "yourtokenhere"

So you have to do just that and check other commands also for process.env.XY

3.2 Prefix

To customize prefix, open index.js and look at line 5 and you'll find this const prefix = "m!"; //change to your prefix

So just change the m! to your prefix

3.3 Commands

All commands are located in the "cmds" folder and because I am using a command loader, it has a specific structure

Command structure

Some commands need an API token that I cannot share, so you need to grab one yourself (Those commands mostly contain process.env.XY)

4. Running the bot

To run the bot simply open a console in the folder and type node index.js

If you did everything right it should start up and say "Bot is online"

Please note that the bot includes code for posting server count on various sites so please check the index.js and ping.js files for such code (should be commented)