Skip to content

tahosa/discord-util-bot

Repository files navigation

scoresaber-bot

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 friends
  • mtg: Card search for Magic: The Gathering
  • uwu: 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.

Running

The bot is set up to be run using Docker. To start, do the following:

  1. Create your server config file
  2. 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
  3. Build the container with docker build . -t discord-util:latest
    • Eventually it will be pushed to docker hub, but not yet
  4. 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.

Configuring

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.

bot_token

The bot token from your Discord app page as a quoted string. This is used to authenticate with Discord and start the bot.

Task Configuration

Developing

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

Debugging

Run the application with python3 app/app.py. If you are using VS Code, a launch configuration has been provided.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published