Skip to content

joinandplaycoop/Bot

Repository files navigation

logo
GitHub last commit Fork Discord

Join and Play Coop repository

Project Code Name: StatBotorio

Requires Python 3

  1. Install
  2. Commands

Licence

Install

Linux Debian based setup (tested on ubuntu)

Install python3.7 and pip 3.6 to get the lastest pip3.7

apt install python3.7 python3-mysqldb python3-apt python3-pip python3.7-dev default-libmysqlclient-dev -y

Clone the bot

git clone https://github.com/joinandplaycoop/Bot.git

Move to the Bot's folder

cd Bot

Install the requirements with pip and using the requirements file

python3.7 -m pip install -r requirements.txt

Move to src and run the bot

cd src
python3.7 StatBotorio.py
If you have any issues with a module try to run this
apt remove python3-apt
apt install python3-apt
apt install python-mysqldb
apt install python3.7-dev default-libmysqlclient-dev

Config

remove ".example" from the file called "config.json.example" populate the botToken and the connection string for MySql

Update Database schema

If the schema is updated in the database, the models will have to be updated also. the models are are contained in data/schema.py use sqlcodegen to generate the models automatically with your MySql Connection string. Here is an example:

use sqlacodegen --outfile schema.py mysql://username:[email protected]:port/database

Even when you close the session have the bot running (not nessecary)

Run via screen (in the bot/src folder)

screen -dmS StatsBot python3.7 StatBotorio.py

Commands

  • Admin Commands
    • load [extension_name : str] - Loads an extension
    • unload [extension_name : str] - Unloads an extension
    • reload [extension_name : str] - Reloads an extension
    • cogs - Lits all extensions in directory
    • latency - Bots connection to discord
    • activity [activity : str] - Set the activity of the bot
  • Player Stats
    • joined [member : discord.Member] - Says when a member joined. (@mention player)
    • ping1 - Debug command from player stats
  • Server Stats
    • ping2 - Debug command from server stats
    • online - Shows table of who is online
  • Debug (realoded in python every command. live testing)
    • t1 - test 1 command for development

About

A discord bot that retrives stats of a mysql database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published