main | ||
dev |
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.
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.
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.
- 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. - If you set the environment variables in the previous step run
clj -T:run source
, otherwise runclj -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).
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
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...).
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
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.
Copyright © 2020 Peter Monks
Distributed under the Apache License, Version 2.0.
SPDX-License-Identifier: Apache-2.0