Skip to content

b34rn00b/Discord-Bot-4x1s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Discord CTF Bot

A Discord bot for managing Capture The Flag challenges with slash commands for creating challenges, submitting flags, and viewing the leaderboard.

Features

  • /createchallenge – Opens a modal for privileged users to publish a challenge announcement in the configured channel. Collects title, description, flag, flag format, optional file links, points, and difficulty. Flags are stored securely and never shown in public messages.
  • /submit – Allows players to select a challenge and submit a flag. Correct submissions award the challenge's points; duplicate solves are detected.
  • /leaderboard – Displays the current standings, including total points and number of solves per player.

Prerequisites

  • Python 3.10+
  • A Discord application with a bot token and the necessary gateway intents (Server Members Intent is required for leaderboard names).

Setup

  1. Install dependencies:

    pip install -r requirements.txt
  2. Create a .env file in the project root containing:

    DISCORD_BOT_TOKEN=your_bot_token_here
    # Comma-separated list of guild IDs for faster command sync (optional)
    DISCORD_GUILD_IDS=123456789012345678,987654321098765432
    # Channel ID where new challenges should be announced (optional)
    CHALLENGES_CHANNEL_ID=123456789012345678
  3. Invite the bot to your server with the applications.commands and bot scopes. Grant it the permissions needed to post in the challenges channel.

  4. Run the bot:

    python -m bot.bot

Usage Notes

  • Only members with the Manage Server permission can run /createchallenge.
  • If CHALLENGES_CHANNEL_ID is not set or cannot be found, new challenges are posted in the channel where the command was used.
  • Challenge data and leaderboard progress are stored in data/store.json.

Development

Challenge storage is file-based JSON for simplicity. If you need to reset the state, delete data/store.json while the bot is offline.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages