This is a Discord bot for handling multiple functions within your discord server. Currently, the following tasks are available:
scoresaber
: Tracking scoresaber high scores among your friendsmtg
: Card search for Magic: The Gatheringuwu
: Fun test to see if the bot is working
To see all command available from the server, get the bot running and send the message !help
for the full list. This is also available to get help with specific commands.
The bot is set up to be run using Docker. To start, do the following:
- Create your server config file
- Enable the modules you wish to use (currently
scoresaber
)- (Optional) Create an empty file for the scoresaber database if you are using that task. This is useful if you want the database to be re-used if you need to tear down the container for any reason, e.g. updating
- Build the container with
docker build . -t discord-util:latest
- Eventually it will be pushed to docker hub, but not yet
- Start the container and mount the server config and other relevant files (this example includes the scoresaber database)
docker run -d --mount type=bind,source=/path/to/scores.db,target=/discord-util/scores.db --mount type=bind,source=/path/to/server.cfg,target=/discord-util/server.cfg discord-util:latest
- This command assumes you are using
scores.db
as the database name for scoresaber inside your server config. Update that mount if you are using something else.
Make a copy of server.cfg.template
called server.cfg
. The only top-level value to configure is the token your bot will use to authenticate to discord for all the tasks. Everything operates using the same bot, so only one token is necessary. For more information on discord bot users, see their documentation.
See the appropriate docs for each task to see how each is configured.
The bot token from your Discord app page as a quoted string. This is used to authenticate with Discord and start the bot.
The recommended use is to set up to use pyenv
or virtualenv
(or both) to manage the python dependencies. Currently, the bot has been developed and tested using python 3.8.
pyenv virtualenv <version> discord-util-bot
pyenv activate discord-util-bot
pip install -r requirements.txt
This assumes you have configured pyenv correctly and set up the shim wrappers on your $PATH
Run the application with python3 app/app.py
. If you are using VS Code, a launch configuration has been provided.