This is a Discord bot built with discord.py
to facilitate typing contests in a server. The bot enables users to start contests, join them, submit WPM (words per minute) results, and display rankings based on average WPM.
- Python 3.11+
- Poetry (recommended) or pip
git clone https://github.com/your-username/typing-contest-bot.git
cd typing-contest-bot
If you haven't installed Poetry yet, use the following command:
curl -sSL https://install.python-poetry.org | python3 -
Then, install all dependencies by running:
poetry install
Activate the virtual environment:
poetry shell
Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
Then, to install all dependencies, run:
pip install -r requirements.txt
Create a config.json
file in the ./config/
directory with the following structure:
{
"token": "your-discord-bot-token",
"typist_role_name": "your-server-typist-role",
"testing_role_name": "your-server-testing-role", // Optional, required only for debug mode
"contests_held": 0
}
To start the bot, run:
python main.py # Or `poetry run python main.py` if using Poetry
!start
: Start a typing contest in the current channel.!end
: End the current typing contest.!status
: Check the status of the typing contest.!join
: Join the typing contest.!quit
: Quit the typing contest.!list
: Display all current participants in the typing contest.!next
: Proceed to the next round in the typing contest and view the current WPM results.!wpm {wpm}
: Submit your WPM result for the current round.!result
: View the WPM results table at any time, not just after advancing rounds.!remind
: Sends a reminder to participants who haven't submitted their WPM for the current round. Use this if the round has ended and some participants have not yet submitted their results.!remove {member}
: Remove a participant from the typing contest. Only the contest creator can use this.!ban {member}
: Ban a participant from the typing contest. Once banned, they cannot join again. Only the contest creator can use this.!getrole
: Assign yourself the typist role.!commands
: Show this list of commands.
Please see the CONTRIBUTING.md for guidelines on contributing to this project.
This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE
file for details.