To Edit or To Install

I have uploaded the code onto GitHub for anyone that is looking to edit code or add commands on their own. If you want to do that, the following instructions should help you get him up and running.

If you do not want to go through the hassle of installing everything and hosting Mouse Bot on your own server, then you can simply use the following link to add him to your server. Add Mouse Bot to your server.

Please note, this is still beta. I am still working out the kinks and if he goes offline for some time and I don’t catch it, just let me know and I will get him back up.

Requirements

Cloning and Installing

Using the terminal inside the directory you want to put the folder, type:

git clone https://github.com/rmgirardin/mouse-bot.git

Then go into the mouse-bot folder with cd mouse-bot and run npm install. This will install all the node modules you need to run the bot.

Setting up and Running

Rename config.js.example to config.js

With your code editor, open the config.js file:

  • Enter your bot’s token within the empty quotation marks after "token":
  • Enter your Discord ID within the empty quotation marks after "admins":
  • To get your Discord ID follow these instructions

In the command prompt within the root project folder directory, you can run the bot with node index.js. Alternatively you can use node and drag the folder path into the terminal.

If you decide to use PM2, you do not need to do this. See below for instruction on how to use PM2.

Now you just need to invite your bot to your server. You can generate a full OAuth Link here. The Client ID can be found the same place you found your bot token.

Using PM2

Install PM2 with npm i pm2 -g

To begin running your app with PM2, just type:

pm2 start index.js -n mousebot

All your PM2 commands might require you to use sudo before the command if you are using a Mac or Linux. We've given the app the name mousebot with -n mousebot. This will make it easier to call in the future.

Now finish the setup with pm2 startup and follow the instructions. If you are on Windows, you will need to install pm2-windows-startup.

Mouse Bot should now run even when you close the terminal. You can restart the app with pm2 restart mousebot. You can also use pm2 monit to monitor the app and watch real-time log.

Adding Commands

You can add commands by creating new files in the commands folder (new-command-name.js). To use new commands, you’ll need to restart the bot by hitting ctrl+c and retyping (or hitting the up arrow key) node index.js. If you are using PM2, you can just type pm2 restart mousebot. If you are just editing already loaded commands while your bot is running, as the bot owner, you can use the reload <command-name> command within Discord to reload commands without restarting your bot.

results matching ""

    No results matching ""