A Discord bot for managing f-code candidates.
- Ping the bot to check if it's online.
- Get help with the bot's commands.
- Add, delete, and verify candidates.
- Clone the repository:
git clone https://github.com/your-username/f-code-operator-bot.git
- Install the Rust toolchain: https://www.rust-lang.org/tools/install
- Create a
.envfile and add the following environment variables:DISCORD_TOKEN=your-discord-token - Run the database migrations:
sqlx migrate run
- Run the bot:
cargo run --release
The following commands are available:
Test if bot is responsive.
Example:
/ping
Shows a help message, either for all commands or for a specific command.
Parameters:
command(optional): The command to get help for.
Example:
/help
/help add
Add one or more candidate IDs to the candidates database from a text file.
Permissions: Moderator
Parameters:
id: A text file with candidate IDs (one per line, UTF-8).
Example:
/add [attach file with IDs]
Delete a candidate by ID from the candidates database.
Permissions: Moderator
Parameters:
id: The ID of the candidate to delete.
Example:
/delete SE1000
Verify a candidate and assign a role upon success. The bot will check if the user's nickname or global name contains the provided ID.
Parameters:
id: The candidate's ID to verify.
Example:
/verify SE1000
The bot uses an SQLite database to store information about candidates. The database is created automatically when the bot is first run. The database schema is defined in the migrations directory.