Skip to content

hyperdargo/Discord-CTF-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

20 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


๐ŸŽฏ Discord CTF Challenge Bot

Discord Music Bot GitHub

A powerful and lightweight Discord bot for hosting and managing Capture The Flag (CTF) challenges in your server.

โœจ Includes dynamic scoring, real-time flag validation, modals for admins, and a competitive leaderboard system.


๐Ÿš€ Features

  • ๐Ÿ› ๏ธ Create, edit, and delete CTF challenges via interactive modals
  • ๐Ÿงฉ Flag submission with automatic validation
  • ๐Ÿ“‰ Dynamic point system based on number of solves
  • ๐Ÿ“ข Auto-announcement of new challenges
  • ๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ User profiles and leaderboard
  • ๐Ÿ” Separate help commands for users and admins
  • ๐Ÿ’พ Data stored locally using SQLite

๐Ÿง  Dynamic Points System

Each challenge begins with 1000 base points. As more players solve it, the point value decreases using the formula below:

points = Math.max(100, 1000 - (solves * 50));
  • ๐Ÿฅ‡ First solver: 1000 points
  • ๐Ÿ“‰ Each additional solver: -50 points
  • โ›” Minimum value: 100 points

This scoring system promotes fast solving and balanced competition.


๐Ÿ“œ Help Commands

๐Ÿ‘ค Normal Users

,help

Shows:

  • How to submit flags
  • View user stats and rank
  • Access leaderboard
  • General usage guide

๐Ÿ‘‘ Admins

,help-admin

Displays:

  • Challenge management tools
  • Format and category setup
  • Required bot permissions
  • Announcement and submission channel setup

๐Ÿ” To use admin commands, set your admin role ID in the .env file:

ADMIN_ROLE_ID=your_discord_admin_role_id

โš™๏ธ Configuration (.env)

Create a .env file and fill in the following:

DISCORD_TOKEN=your_bot_token_here
ADMIN_ROLE_ID=your_discord_admin_role_id
ANNOUNCEMENT_CHANNEL=channel_id_for_announcements
SUBMISSION_CHANNEL=channel_id_for_flag_submissions

Refer to .env.example for a prefilled template.


๐Ÿงฑ Database (SQLite)

The bot uses SQLite to persist all data.

Tables:

  • users โ€“ User ID, username, total points, rank, challenges solved
  • challenges โ€“ Challenge info: name, category, difficulty, flag, points
  • submissions โ€“ Track when users submit flags and earn points

๐Ÿ“ฆ Installation

1. Clone the Repository

git clone https://github.com/hyperdargo/Discord-CTF-Bot
cd Discord-CTF-Bot

2. Install Dependencies

npm install
npm install discord.js dotenv sqlite sqlite3

3. Configure Environment

Copy .env.example to .env and fill in your credentials.

4. Start the Bot

node index.js

๐Ÿงพ Admin Challenge Modal

Admins can manage challenges directly through Discord modals. Fields include:

  • name โ€“ Challenge name
  • difficulty โ€“ Easy / Medium / Hard
  • description โ€“ Brief explanation
  • category โ€“ Web, Crypto, Forensics, etc.
  • flag_format โ€“ Expected format (e.g., flag{})
  • flag โ€“ Actual flag
  • links โ€“ Optional resources

๐Ÿ“ Release Package

Release archive includes:

  • index.js โ€“ Main bot logic
  • .env.example โ€“ Config template
  • package.json โ€“ Node.js dependency file
  • requirements.txt โ€“ Optional dependencies

Supported archive formats: .zip, .tar, .rar, .7z


Contributing ๐Ÿค

Contributions are welcome! Please open an issue or submit a pull request for any improvements.

License ๐Ÿ“„

This project is licensed under the MIT License - see the LICENSE file for details.

Enjoy the CTF Bot! ๐ŸŽถ If you like the bot, consider giving it a โญ on GitHub!


๐Ÿ”— Join Our Community

  • ๐ŸŽฎ Main Discord: Join Discord Server
  • ๐Ÿงช Public Bot: Invite DTEmpire Music Bot

๐Ÿ“ธ Preview

Screenshot 1

Screenshot 2

Screenshot 3

Screenshot 4


About

Discord CTF Challenge Bot By DTEmpire

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published