Skip to content

We are developing a bot for R&D Project, that is made for turn-based games in discord.

Notifications You must be signed in to change notification settings

Rijkkie/R-D_Game_Bot

Repository files navigation

Game_Bot

We are developing a bot for R&D Project, that is made for turn-based games in discord.

How to install and setup the bot and the database.

  • (Optional) Use a VPS to host the bot and database We assume you have python installed.
  • (Optional) Create a virtual environment
  • Change directory to the gamebot file and use pip3 install -r requirements.txt (Optionally inside the virtual environment). (Required)
  • Install MYSQL, in our case we have installed Ver 8.0.25 for Linux.
  • Create a database like so:

image

  • Now do the following commands: USE yourdatabasenameand source directorytogamebot/database/dbscripts/dbtables.sql where you change 'directorytogamebot' to your directory to the gamebot and use exit to close the MYSQL environment.
  • Now that you are done with setting up the database, edit config.json with your discord bot token and MYSQL user, password, host and the same yourdatabasename as previous steps.
  • (Run the virtual environment if you made one and) If everything went correctly, you should be able to run python3 main.py. (To run a command 'forever', use nohup python3 main.py & on linux/vps server)

How to setup the website using Apache2 and mod_wsgi

This will be a lot more complicated, so I will be giving a brief explanation how it should be done using our files? Install and enable apache2 and mod_wsgi and then change the apache DocumentRoot to the gamebot directory. And then configure the mod_wsgi If you know how to setup a virtual environment using mod_wsgi, which we weren't able to figure out you could use the same virtual environment as explained in how to setup the bot and the database.

Instead we didn't know how to do that, so we globally installed the packages. And changing the DocumentRoot directory did not work for us either, so we moved the FlaskApp folder to /var/www and added the config file and database folder at /var/www/FlaskApp. I think it was very unfortunate that we weren't able to keep everything in one project.

A pretty handy link on how to deploy a flask application https://www.digitalocean.com/community/tutorials/how-to-deploy-a-flask-application-on-an-ubuntu-vps

You could however easily open the website on the localhost without apache2 and mod_wsgi, by just running app.py. This does require the database to be set up though!

About

We are developing a bot for R&D Project, that is made for turn-based games in discord.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages