A Discord bot that fetches upcoming Capture The Flag (CTF) events from CTFtime and posts them in a designated Discord channel.
- Fetches and displays the latest CTF events.
- Sends weekly announcements for upcoming CTFs.
- Uses embeds to format event details.
- Includes event logo, start time, end time, and prizes.
ctftime-discord-bot/
│── ctf_bot.py # Main bot script
│── requirements.txt # Python dependencies
│── .env # Environment variables (DO NOT SHARE)
│── README.md # Project documentation
│── .gitignore # Ignoring sensitive files
- Python 3.8+
- A Discord bot token
nextcordlibrary- A happy life
- Clone the repository:
https://github.com/make-ki/ctftime-discord-bot cd ctfime-discord-bot - Create a virtual environment (Recommended though Optional):
python3 -m venv myenv source myenv/bin/activate # On Windows, use myenv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Create a
.envfile and add (or hardcode if running locally):TOKEN = your_discord_bot_token CTFTIME_API = ctftime_v1_events_api CHANNEL_ID = discord_channel_to_send_message CTF_ROLE_ID = discord_role_you_want_to_ping
python ctf_bot.py- Use Railway, Fly.io, or a free VPS for 24/7 hosting.
- DO NOT hardcode tokens in the script.
- Use
.envfor secrets and add.envto.gitignore. - Rotate your tokens if exposed.
MIT License
Feel free to submit pull requests or issues. I am not very smart so I won't mind. I will be adding more features to it in upcoming weeks.
Maintained by make-ki