- Python 3.9
- MariaDB 10.6 running at localhost at the default port
- Discord bot account
- create a Discord bot account: https://discordpy.readthedocs.io/en/stable/discord.html
- enable
Server Members Intent
andMessage Content Intent
- save the token securely
- invite the bot to your server
- TODO: what are the exact required permissions?
- quick test with permissions integer
397552987232
seems to work
- enable
- clone this repo
- copy
config.yaml
toconfig_local.yaml
- change local config variables db_name, db_password and db_user to your liking, each referred to later with the same parameter name
- change local config variable for token from what you got from Bot setup above
- install MariaDB, use default port etc. and start server (Windows installer starts it for you)
- login as root user as per install credentials
- login
.\mariadb -u root -p
(.\ for Windows PowerShell) - enter password
- should now see in prompt: "MariaDB [(none)]".
- login
- create database and user for bot
CREATE DATABASE db_name;
- get user password hash pw_hash
SELECT PASSWORD('db_password');
- create user with password
CREATE USER db_user IDENTIFIED BY PASSWORD 'pw_hash';
- grant privileges to database
GRANT ALL PRIVILEGES ON db_name.* TO db_user;
- create a venv:
python -m venv venv
- activate the venv:
- linux:
source venv/bin/activate
- windows:
venv\scripts\activate
- linux:
- install requirements:
pip install -r requirements.txt
- start the bot with
python bot.py