Skip to content
/ futbot Public

A Discord bot that delivers football (soccer) information to Discord.

License

Notifications You must be signed in to change notification settings

pmonks/futbot

Repository files navigation

main CI Dependencies
dev CI Dependencies

Open Issues License

futbot logo

futbot

A small Discord bot that provides football (soccer) competition information sourced from football-data.org, as well as posting new LotG quizzes posted by the Dutch Referee Blog and CNRA, and videos posted by a number of referee-focused YouTube channels. This bot has been deployed to the Referee Discord Server, and was specifically designed and implemented for that community, and may therefore have limited utility elsewhere.

The bot also has a small, but growing number of "responsive functions" - command messages that it will respond to in any channels it has been added to.

Please review the privacy policy before interacting with the deployed instance of the bot on the Referee Discord Server.

Running Your Own Copy of the Bot

Obtaining API Keys

Configure a Discord bot using the Discord developer portal, obtaining an API key. Detailed instructions on this process are provided in the discljord project.

Obtain an API key for football-data.org.

Obtain a Google API key.

Running the Bot

Currently the bot is only distributed in source form, so regardless of how you intend to deploy it, you'll need to clone this repository locally.

Direct Execution

  1. Either set environment variables as described in the default config.edn file, or copy that file somewhere else and hardcode the values in the file directly.
  2. If you set the environment variables in the previous step run clj -T:run source, otherwise run clj -T:run source -c /path/to/your/config.edn

Note that the run tool alias has other variations (e.g. to run the bot as an uberjar).

Dockerised Execution

Copy the default config.edn file to ./docker-config.edn, and edit the entries in the file for your needs.

Build the container:

docker build -t futbot .

Run the container:

# Interactively:
docker run futbot

# In the background:
docker run -d futbot

Generating the IST Markov Chain

The Markov chain containing the analysed IST YouTube Channel's video titles can be (re)generated by running:

clj -T:ist generate-markov :youtube-api-key "YOUR_GOOGLE_API_KEY"

Note that this command has the side effect of dropping a titles-YYYY-MM-DD.edn file in the current directory the first time it's run each day. This is a workaround for YouTube's draconian API call quotas. Deleting or renaming the file will force the code to call the YouTube APIs again (which may then fail, due to those quotas...).

Contributor Information

Contributing Guidelines

Bug Tracker

Code of Conduct

Developer Tools

futbot uses tools.build for development-time automation. The full list of available build tasks can be obtained by running:

$ clojure -A:deps -T:build help/doc

Developer Workflow

This project uses the git-flow branching strategy, with the caveat that the permanent branches are called main and dev, and any changes to the main branch are considered a release and auto-deployed (push to Heroku).

For this reason, all development must occur either in branch dev, or (preferably) in temporary branches off of dev. All PRs from forked repos must also be submitted against dev; the main branch is only updated from dev via PRs created by the core development team. All other changes submitted to main will be rejected.

License

Copyright © 2020 Peter Monks

Distributed under the Apache License, Version 2.0.

SPDX-License-Identifier: Apache-2.0

About

A Discord bot that delivers football (soccer) information to Discord.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages