Skip to content
Brussell edited this page Aug 13, 2016 · 17 revisions

Using my version of the bot

Go to Carbon's Bot list and invite the bot.

Running your own version

OUTDATED (WRITTEN FOR V2)

  1. Local
  2. Heroku
    • Someone could write this for me I don't feel like it Done!

Local (Windows)

This section is for running the bot locally on Windows. If you're on Mac it should be similar. I assume Linux users can figure it out.

Download Python 2.7.X

Go to the downloads page on python.org and get the latest 2.7.X installer.

Install Python 2.7.X

Open the installer that you downloaded. Make sure Install for all users is selected, then continue.
Enable all of the options. Most importantly the "Add python.exe to Path" one:
Enable "Add python.exe to Path"
Then install it and close the installer

Download Visual Studio

This step isn't needed unless you added voice support
Next we need to download Visual Studio because it has a C++ compiler.
Go to the Microsoft Visual Studio website and click Download Community 2015.

Install Visual Studio

Open vs_community_ENU.exe
Check only the Common Tools for Visual C++ 2015 box like so:

Now install. This will take a long time.

Download Node.js

Node.js is what will be used to run the bot.
Download Node.js 6.X from the website.

Install Node.js

Open the Node.js Setup.
In the options, make sure Node.js runtime npm package manager and Add to PATH are enabled. After that install Node.js.

Download Git

And install it. The website is http://git-scm.com and make sure you choose "for command prompt".

Download and Install BrussellBot

Next you'll need to download the bot and configure it.
Download the master branch and put the unzipped files in a new folder on your computer.
Next open up bot/config.json and enter the correct information. The config guide can be found here.

Before running the bot you need to install the dependencies.
In the folder you put the files in, Shift+Right click and select open command window here.
In the command prompt type npm install. If you finished all of the above you should be fine. You can ignore some of the errors.

The bot should now be ready!
Open a command prompt like above and type node BrussellBot.js to start the bot.
For a better experience download cmder and use that instead of cmd


Heroku

No longer supported. If you really want to do this download the public branch and make any necessary modifications to update it.

Install the Heroku Toolbelt

Get it from here, using the installer for your operating system. Make sure to run heroku login from the command line and enter your credentials.

Get the latest version of the bot

Either clone this repo (git clone -b public --single-branch https://github.com/brussell98/BrussellBot.git from the command line) or get the latest download from the releases page.

Install Node.js, Python 2.7.X, and Git

If you're using Linux, follow the instructions for installing Node.js here, following the instructions for 5.x versions. Also if using Linux, find instructions to install Python and Git for your distro and follow them.

Install dependencies

Windows

Shift-RightClick in the folder that you downloaded and select Open command window here. Then type npm install and hit Enter.

Linux

cd to where you cloned the GitHub repo and type sudo npm install. This will take a while.

Get the bot up and running

  1. Edit bot/config.json to your liking, using the guide here. Make sure to leave use_env as false!
  2. Type heroku create, which will create a new application with a random name. If you want to specify a name, type heroku create your-name-here. If it gives some error about it not being a git repository (if you downloaded BrussellBot from the releases page), type git init and then heroku create again.
  3. To make sure that the changes you made to bot/config.json are included, type git add . and git commit -m "Added credentials", with the latter command mentioning edits. If it gives an error about CRLF being replaced by LF or vice versa, type git config --global core.autocrlf false and hit Enter, then try again. If you get something asking about who you are, type git config --global user.name "your name here" and git config --global user.email "your email here", then type git commit --amend --reset-author and save the file that pops up.
  4. Send the changes off to Heroku by typing git push heroku master. Follow the output of that command and make sure that the deploy is successful.
  5. It seems that the deploy only works for an hour before logging out. Time to fix that. Copy the below code snippet and paste it into the bottom of BrussellBot.js:
var http = require("http");
    setInterval(function() {
        http.get("http://sheltered-river-1376.herokuapp.com"); // insert your application's URL here
    }, 1320000); //every 22 minutes to keep the bot from sleeping which breaks it
  1. Next, create a file called index.js with the following code in it:
var http = require("http");

http.createServer(function(request, response) {
  response.writeHead(200, {"Content-Type": "text/plain"});
  response.write("Hello World");
  response.end();
}).listen(80);
  1. git add ., git commit -m "added index.js, keepalive script", git push heroku master, and you're...
  2. Done! Make sure to test the bot out with a couple commands, including both normal and administrative.