Quizzo
Quizzo is a Discord bot for making simple quizzes.
Development
This bot is powered by the Twilight library for the Rust programming language. Before running the bot, the following environment variables must be set:
| Variable | Description | Required? | Default |
|---|---|---|---|
PORT |
Network port to bind to when launching the bot. | ✔ | |
PUB_KEY |
Hex-encoded cryptograhpic public key provided by the Discord Developer Portal. | ✔ | |
APP_ID |
Application ID provided by the Discord Developer Portal. | ✔ | |
BOT_TOKEN |
Bot token provided by the Discord Developer Portal. | ✔ | |
PG_PORT |
Port at which the PostgreSQL instance is hosted. | ❌ | 5432 |
PG_HOSTNAME |
Hostname at which the PostgreSQL instance is hosted. | ✔ | |
PG_DATABASE |
Default database to which the PostgreSQL driver must connect to. | ✔ | |
PG_USERNAME |
Username for PostgreSQL user authentication. | ✔ | |
PG_PASSWORD |
Password for PostgreSQL user authentication. | ✔ |
Once these are available, one may use Rust's built-in package manager Cargo to launch the bot.
# Initalize the `data/` folder for PostgreSQL
deno task init
# Start the PostgreSQL instance
deno task db# Initialize the template database
deno task template
# Instantiate the template
deno task create
# Register the required commands
BOT_TOKEN=
GUILD_ID=
deno task register
# Start the bot!
PORT=
APP_ID=
PUB_KEY=
PG_PORT=5432
cargo run --release