Requires Python 3
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
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
Run via screen (in the bot/src folder)
screen -dmS StatsBot python3.7 StatBotorio.py
- 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