Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

1. Install

shibdib edited this page Feb 5, 2017 · 7 revisions

Notes

  • The bot requires a 64 bit OS to work.
  • This wiki will get a bot running but is in need of some TLC

Step 1 - Install required stuff

Google how to install a LAMP stack.. this will give you the required PHP and MYSQL needed to run this bot, and those guides will explain what to do better than I can.

Once you've done that go ahead and install the other required items. sudo apt-get install curl php5-cli git php5-mysqlnd libsqlite3-dev php5-sqlite php5-curl

Then run sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer to install composer.

Step 2 - Clone

Go to whatever directory you want to contain the bot folder. And run git clone https://github.com/shibdib/Dramiel.git

This will give you the folder Dramiel which contains the latest master release.

Step 3 - Composer and Configure

Go into the bots folder and type sudo composer install to install dependencies.

Next go into the config folder. Here you will see a file called config.new.php

Open this using the text editor of your choosing and begin editing it to your hearts content. Each option includes a description of what it does, and some need not be filled out unless you intend to use specific plugins. I'll expand the configuration section of the wiki when I get time.

Once done messing with that file, save it and rename it to config.php

Step 4 - Register your bot

Head on over to https://discordapp.com/developers/applications/me and register an application. Name it whatever you want the bot to be named. One the app is created click the Create Bot User button. This will give you the token for the config file.

Step 5 - Invite your bot

Now that the bot is running you need to invite it to your server. Go back to your discord application page and look for the client/app id. Next head too https://discordapp.com/oauth2/authorize?&client_id=**INSERT_ID_HERE**&scope=bot and authorize it for your desired server.

Step 6 - Supervisor

The easiest way to launch this bot is to use supervisord. Install supervisord with sudo apt-get install supervisor and follow that with a supervisorctl restart.

Next head to /etc/supervisor/conf.d and once here create a file called dramiel.conf

Inside this file include the following (if you know what you're doing edit to your choosing.)

[program:dramiel]    
command=php /directory to your bot folder/Dramiel/Dramiel.php    
autostart=true    
autorestart=true   
stopasgroup=true    
stderr_logfile=/directory to your bot folder/Dramiel/log/dramielError.log
stdout_logfile=/directory to your bot folder/Dramiel/log/dramielOther.log
stdout_logfile_maxbytes=100KB
stdout_logfile_backups=3
stderr_logfile_maxbytes=100KB
stderr_logfile_backups=3
priority=998 

Now save that file and run supervisorctl update which will detect and start your bot. In the future to start/stop/restart the bot use supervisorctl start/stop/restart dramiel