This Discord bot will be used to track "karma" of users, similar to Reddit. Upvote and downvote reactions will be counted and be able to be queried for.
First, install dependencies with Poetry.
poetry install
Then, set the KARMABOT_TOKEN
environment variable. See the Environment section for more info. .env
should look like this:
KARMABOT_TOKEN=...
Finally, run the main bot script with Poetry.
poetry run python src/bot.py
key | description |
---|---|
?karma [user] |
Replies with the karma of the user. If no user specified, uses sender. |
?leaderboard [member_count] |
Replies with the users that have the most karma in the guild. |
?scan |
Scan the guild for karma in past messages. |
Edit the configuration file located at config.json
.
key | description | type | default |
---|---|---|---|
upvote_emojis | A list of emojis OR name of server emotes that represent upvotes | list[string] | ["⬆️", "👆", "👍"] |
downvote_emojis | A list of emojis OR name of server emotes that represent downvotes | list[string] | ["⬇️", "👇", "👎"] |
command_prefix | The command prefix for KarmaBot | string | ? |
Environment variables are loaded from a .env
file.
key | value | required | default |
---|---|---|---|
KARMABOT_TOKEN |
Discord bot token | Yes | None |
LOG_LEVEL |
Log level | No | INFO |
To run unit testing, run the command poetry run pytest
, or using Make, make test
.
To generate coverage, run the command poetry run coverage html
, or using Make, make coverage
.
See LICENSE