A Discord bot to manage CTF challenges in the CyberStudents Discord server
To see the bot in action, join the CyberStudents Discord server and use the /help
command to get started.
- Uses Discord interactions and components (e.g. slash commands, buttons, modals)
- Hint request system with points
- Cooldown system for flag submissions
- Leaderboard for current round
- Optional anonymous mode
- Manage challenges and users (including blacklist)
- Flag publishing protection
- Solved discussion threads
To locally install the bot yourself (e.g. if you want to contribute or self-host), follow these steps:
- Node.js 16.11.0 or later
- Yarn berry (v4)
- A Discord application and bot
- A PostgreSQL database (to run one locally, see here)
Once you've cloned the repository from GitHub, install the required Node dependencies.
yarn
Copy the .env.example
file to a new .env
file and the config.example.json
file to a new config.json
file. Then,
fill out the environment variables and configuration values listed inside.
cp .env.example .env
cp config.example.json config.json
Push the Prisma schema to your Postgres database.
yarn push
# If you don't have a database yet, you can still generate typings
yarn generate
Compile the bot with tsc. Leave this terminal tab open while developing the bot. In production, you can use yarn build
instead.
# Development (watch mode)
yarn build:dev
# Production
yarn build
Finally, you can run the bot using nodemon in development or pm2 in production.
# Development
yarn dev # nodemon
# or
yarn start # node
# Production
pm2 start dist/src/index.js
If you need support with the bot, feel free to contact GodderE2D on Discord after joining the server.
If you'd like to contribute to the bot, please review our code of conduct first. If you have a bug report, feature request, please open an issue. If you're interested in fixing a bug or adding a new feature, please open a pull request.
If you'd like to report a security vulnerability or otherwise want to contact me, please email me at goddere2d@bsr.gg or godderseesyou@gmail.com.
- Please follow the conventional commits specification where possible
(you may also use
docs
,chore
or other headers). - Please use
yarn test
to ensure TypeScript, ESLint, and Prettier checks pass. - Please do not include out-of-scope changes in a PR, instead open a separate PR for those changes.
- Please do not use translators to edit language files.
CyberStudents CTF is licensed under the Apache License 2.0.