Skip to content

A Discord bot that keeps you updated on Capture The Flag (CTF) events! With real-time data from CTFTime, it provides upcoming event listings, team stats, and comparisons. Admins can compare teams' performances, track top CTF events, and more using simple slash commands. Perfect for CTF enthusiasts and communities!.

License

Notifications You must be signed in to change notification settings

TheLeopard65/CTF-Tracker-BOT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CTF-Tracker-BOT

CTF-Tracker-BOT is a powerful and efficient Discord bot that provides real-time updates and insights on Capture The Flag (CTF) events, directly integrated with CTFtime. It enables users to track upcoming CTF events, view detailed information about teams, and even compare performance across multiple teams. Perfect for competitive CTF participants and organizers alike, this bot simplifies tracking and management of CTF competitions.

Features

  • Real-Time CTF Updates: Get the latest upcoming CTF events from CTFtime.
  • Team Information: Retrieve detailed information on teams, including their rank, points, and history in previous events.
  • Team Comparison: Compare multiple teams' performances based on their most recent 5 CTF events.
  • Command List:
    • /help: Displays available bot commands.
    • /newctfs: Lists the top upcoming CTF events with flexible sorting options.
    • /teaminfo: Fetches detailed information about a specific team by name or ID.
    • /setteams: Allows admins to set a list of teams to be used in the /compare command.
    • /compare: Compares pre-set teams' performances in their latest 5 CTF events.

Prerequisites

  • Node.js: Ensure you have Node.js installed.
  • Discord Bot Token: You need a valid Discord Bot Token. Follow this guide to create a bot.
  • CTFtime API: This bot relies on the CTFtime API to fetch event and team data.

Setup Instructions

  1. Clone the Repository

    git clone https://github.com/TheLeopard65/CTF-Tracker-BOT.git
    cd CTF-Tracker-BOT
  2. Install Dependencies The bot uses discord.js, node-fetch, and node-cache for its core functionality. Install all dependencies with npm:

    npm install
  3. Create .env File In the root directory of the project, create a .env file and add the following:

    TOKEN=your-discord-bot-token
  4. Start the Bot Run the bot using Node.js:

    npm start
  5. Bot Commands Once the bot is running and added to your server, use the commands below:

    • /help: Displays a help message with all available bot commands.
    • /newctfs [count] [sort]: Fetches and displays upcoming CTF events. You can specify how many events to show and the sorting criteria (e.g., "weight", "start", "end").
    • /teaminfo [teamid]: Fetches information about a specific team by either name or ID.
    • /setteams [team1,team2,...]: Set the list of teams to be used for comparisons in /compare.
    • /compare: Compares the top 5 CTF scores of the teams you've set with /setteams.

Development & Contributions

Feel free to contribute to this project by forking the repository, making changes, and submitting a pull request. Please ensure all code is properly tested before submitting.

Installing Dependencies

To install the necessary dependencies, run:

npm install

Running Locally

To run the bot locally, use the following command:

npm start

Running Tests

Currently, there are no formal tests in place. To add tests, consider using libraries like Jest or Mocha.

Code Structure

  • CTF-Tracker.js: Main bot file handling logic, commands, and API calls.
  • package.json: Manages the bot's dependencies and scripts.
  • .gitignore: Specifies which files and folders to ignore for Git.
  • .nixpacks: Configuration file for deployment on Nixpacks.

Issues & Bugs

If you encounter any issues, feel free to open an issue on the GitHub issues page. We'll do our best to resolve them promptly.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Acknowledgments

  • Discord.js: For providing the necessary framework to interact with Discord's API.
  • CTFtime: For providing the CTF data API.

Support

For any support or questions, feel free to reach out via the GitHub discussions page or create an issue.

Credits

  • Leopard (@theleopard65): The creator and maintainer of the CTF-Tracker-BOT.

Thank you for using CTF-Tracker-BOT! Enjoy tracking your favorite CTF events! 🎉

About

A Discord bot that keeps you updated on Capture The Flag (CTF) events! With real-time data from CTFTime, it provides upcoming event listings, team stats, and comparisons. Admins can compare teams' performances, track top CTF events, and more using simple slash commands. Perfect for CTF enthusiasts and communities!.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published