Skip to content

The BluScreen Discord bot is designed to integrate with the Blugold Group's (University of Wisconsin - Eau Claire's cybersecurity club) activities and operations to enable interaction with the group's website in a more accessible manner

License

Notifications You must be signed in to change notification settings

Blugold-Group/BluScreenBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BluScreen

The BluScreen Discord bot is designed to integrate with the Blugold Group's activities and operations and to enable functionality directly through the Discord server. It facilitates seamless synchronization between Discord and the main website for managing CTFs, challenges, bounties and more.


Features

  • Slash commands featuring modals and simple GUI
  • Sync CTF challenge points from the main website with users' Discord nicknames
  • View CTFs, Challenges, and Submit Flags
  • Create and manage CTFs and Challenges
  • Daily reminders for closing-soon CTFs
  • Display a leaderboard for CTFs/similar events
  • Link Discord account with main site through a simple OTP system
  • Commands for admins and server members to view and manage features from the main site

Architecture

This Discord bot is developed in Python. It makes use of Nextcord, a fork of discord.py. Nextcord was used as discord.py has been abandoned in the past. The two are relatively similar, and porting between them is fairly easy.

Cogs are groups of alike commands. They are great at preventing long files and for allowing future ease-of-development and documentation.

Views contains files for UI-based code. Commands that make use of modals, custom UI, etc, will have a file in views/.

utils/ contains utility-based functions. api.py contains functions primarily for contacting the main site via its API endpoints.


Commands

Commands follow common Discord bot command structure: /<command> <arguments>. Below is a list of all currently implemented commands:

General Commands

  • /leaderboard Display the current CTF challenge points leaderboard in the server
  • /listctfs Display a list of CTFs, with their associated IDs, names, descriptions, and start/end dates
  • /listchallenges View challenges for a selected CTF, as well as buttons to submit FLAG{}s.

Admin Commands

  • /syncpoints Updates all users' server nicknames to include their current challenge points total (e.g., points earned from CTF challenges on the main site). Note: This command skips over bots and server owners. Bots are excluded by default, and server owners' nicknames cannot be changed by bots due to Discord's role hierarchy.
  • /createctf Create a new CTF, specifying name, start date, and end date.
  • /createchallenge Add a new challenge to an existing CTF

Automatic Tasks

  • Event Reminders sends automated reminders to a specified channel when a specified amount of time is left before the CTF closes.
  • Sync Points automatically runs /syncpoints at a specified frequency

Installation

  1. Clone this repository:
    git clone https://github.com/EekRats/BluScreenBot
    cd BluScreenBot
  2. Install the required dependencies:
    pip install -r requirements.txt
  3. Create a file named .env containing:
    DISCORD_TOKEN=<token from Discord Bot Developer Portal>
    API_URL=<API route for main site. blugold.group/api/ at time of writing>
    BLU_API_KEY=<BLU_API_KEY also defined on main site>
    
  4. Edit config.py to customize bot behavior:
    • Set the Discord Guild ID, automatic syncpoints frequency, time left to CTF reminder, and more.
    • COMMAND_PREFIX is deprecated and mostly unused. Slash commands are now implemented
  5. Run the bot:
    python bot.py

Hosting

BluScreen is designed to run alongside the Blugold Group's main website. Ensure that:

  • The bot can access the site's API
  • The bot has the necessary permissions on the Discord server

Contributions

Contributions to BluScreen are welcome and encouraged! If you have any ideas or want to fix inevitable bugs, feel free to submit a pull request, create a fork, or open an issue; or, just mess around with the code and learn something new!


License

This project is licensed under the MIT License. See the LICENSE file for details. This software will, to the best of its ability, abide by the principles of Free and Open Source Software, meaning it is to be shared, modified, contributed to, etc.


About

The BluScreen Discord bot is designed to integrate with the Blugold Group's (University of Wisconsin - Eau Claire's cybersecurity club) activities and operations to enable interaction with the group's website in a more accessible manner

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages