-
Notifications
You must be signed in to change notification settings - Fork 9
Setup
These instructions will help you get ChatBot up and running on your system.
To run ChatBot you need: Node.js, NPM Package Manager and PM2.
WARNING: BACKUP YOUR SD CARD BEFORE INSTALLING, THERE IS A LOW CHANCE THAT THIS WILL CORUPT YOUR SD CARD
You will need:
Raspberry Pi 2/3/3B+ with the latest Raspbian (get here) installed
A Windows/Mac with Putty or somesort of other ssh client installed.
Once connected via ssh run the following commands:
#Removing NodeRed
sudo apt purge node* npm*
#Installing Node
cd ~
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt install -y nodejs
#Check if node and npm are installed
node --version
npm --version
#Clone repo
cd ~
sudo apt install git
git clone https://github.com/TolleyB-J/ChatBot
cd ChatBot
Now continue to the installing step.
Download and install the LTS version of Node.JS from https://nodejs.org/en/
Now Download and install git from https://git-scm.com/downloads
Open a command prompt and navigate to a folder to install the bot using cd foldername
Now run git clone https://github.com/TolleyB-J/ChatBot
Now you are ready to continue to the installing step.
I don't own a mac so it would be much appreciated if someone could tell me how to do it on a mac so I can write a guide
Now we've finished with the prerequisites now we need to install and configure the bot.
Open a command line a navigate to the cloned folder and run the following commands
npm install -g pm2
npm install
Note: During
npm installyou may get some warnings just ignore them.
Go to https://discordapp.com/developers/applications/me
Click on 'New App
Give your bot a name and press 'Create App'
Scroll down and click 'Create Bot User'
Tick Public Bot
Then next to token click 'Click to reveal' WARNING: DO NOT SHOW YOUR TOKEN TO ANYONE, IF YOU ACCIDENTLY SHOW SOMEONE REGENERATE IT IMMEDIATELY
Edit the settings.json Get Here file and place your token in the appropriate slot.
Windows Users: Don't use notepad as this will mess up the json file. I recommend Notepad++
Back on the website click 'Generate OAuth2 Url'
From the list tick the administrator box
Click copy then paste in the join link box of settings.json
Also paste the link into your browser, this wil invite the bot to your server. Your bot will appear offline, don't worry this is normal.
In the discord app, open your user settings then select appearance and turn on developer mode.
Go back to a text channel.
Next to the chat there is a list of names, right click yours and click 'Copy ID'
Paste this in the owner id section of settings.json
Fill in the rest of the options, to obtain a role id type @rolename then copy the NUMBER ONLY and paste in the id box.
Your done! Now your ready to start the bot.
Now run pm2 start app.js --name ChatBot
To automaticly run the bot on start up do pm2 startup follow the on screen instuctions then run pm2 save
If you get an error check your settings.json with this if its not json related raise an issue on github