Skip to content

GGC-SD/DiscordBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DiscordBot

Fall 2023

Description

  • The plan is to automate the cleaning of a Discord server by creating a dedicated Discord bot. The bot will respond to a command and work on a set schedule. It will have configurable options, a customizable blacklist, and a preview feature to show which inactive members are going to be removed.

Technologies Used

Bit Bot Boot Team Roles

Gabriel Kerven https://github.com/GGC-SD/DiscordBot.git

  1. Lead Programmer
  2. Client liasion :boom:

Alexis Pardo

  1. UI/UX Design ✏️
  2. Testing lead πŸ’»

Ravjot Singh https://github.com/GGC-SD/DiscordBot.git

  1. Data Modeler
  2. Team Manager πŸ™‹β€β™‚οΈ

Chidiebube Okebalama https://github.com/GGC-SD/DiscordBot.git

  1. Lead Programmer πŸ’Ύ
  2. Documentation Lead πŸ“‘

Communication Tools

  • Discord

Repo Location

Progress Tracking Tool

Set Up

  • Using your Operating Systems Terminal set the ExecutionPolicy. Use the command: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser.
  • The RemoteSigned is also a safe PowerShell Execution policy to set in an enterprise environment. This policy dictates that any script that was not created on the system that the script is running on, should be signed. Therefore, this will allow you to write your own script and execute it. You would not be able to run a script that was downloaded from the Internet, or got from a friend who wrote it under his account or on a different computer. PowerShell differentiates between script you wrote on that computer, and a script that came from elsewhere using the file metadata.
  • (The scope makes the RemoteSigned only effect a single user instead of allowing all the users to become effected by the terminal command. This is a security precaution.)
  • Install Node.js. and its dependency Chocolatey.
  • Initialize the bots project using command npm init -y.
  • Install nodemon using the terminal and the command npm install -g nodemon (nodemon installation allows the script to run continuously in the background while also autoupdating anytime script is changed in the bot project and saved allowing all changes to be quickly deployed for the bot).
  • Install dotenv on using the terminal and the command npm install dotenv (This causes allows your bot project a place for the bots token to be stored later in the project and then be placed into a gitignore file in order to keep your token and other confidential project information safe if the bot is shared on GitHub.)
  • Install discord.js using the terminal and the command npm i discord.js.
  • Create a Discord bot on the Discord bot Discord Developer Portal.
  • Add the bot's token (Discord developer Portal-> application-> "specific app"-> bot -> Reset Token) to config.json and adjuste the configuration to indicate where the script is on your local machine.
  • Run the bot by using nodemon or nodemon index.js or any other command you prefer.

List of working features

  • Help command: Lists out all the different configuration commands for the bot.
  • Blacklist show command: Shows the current blacklisted user/roles. Blacklisted users will not be purged from the server.
  • Blacklist add command: Lets you add a specific user/role to the blacklist which makes them bypass the purges.
  • Blacklist remove command: Lets you remove a specific user/role from the blacklist.
  • Blacklist Database: Stores user data for the blacklist.
  • Show inactivity command: Shows members who are considered "inactive" that are eligible to be purged.

Project Licencing

Fall 2024

Description

  • Discord is a communication platform designed for creating communities, where users can interact through text, voice, and video channels, while Discord bots are automated programs that can perform tasks such as moderating conversations, managing users, or providing entertainment within these communities. Our team has been tasked with creating a discord bot that can moderate servers. It is able to track activity across multiple channels and can purge users who have been deemed inactive for too long in order to keep the server lean. The main goal is to have this process done in an automated fashion periodically, and for the admins to be able to log into a dashboard to alter settings as needed.

Links

Technologies

Working Features

  1. Dashboard: The bot now has an authenticated login for admins only web based UI dashboard that, in the future, will be the only point of interaction with the bot.
    • Login page which authenticates whether a user has an admin role to access the dashboard.
    • Pages for each command that are accessible from the hamburger in the navbar under 'Commands' which open the sidebar on the left of the page.
      • User Activity - displays an overview of user activity within the application, including their latest messages, reactions, and voice interactions in the ford of an interactive table.
      • Inactivity - displays an overview of inactive users within the application in the form of an interactive table.
      • Purge - displays an overview of inactive users and a history of whom commited a purge.
      • Blacklist - displays an overview of all blacklisted users within the application. Allows the user to select users from the table to remove them from the blacklist.
      • Roles & Timers - displays two tables: User Roles and Role Timer. User Roles provides an overview of each individual users information, including their username, and user id, along with their role names (multiple roles if applicable) in the form of an interactive table. Role Timer an overview of the roles and timer for users within the application.
    • FAQ page displays an accordion of question and commands which are parsed from JSON files in the JSON folder within the frontend JSON folder.
    • 'Logout' button.
    • 'Account' button that currently leads to a skeleton page.
    • 'Home' button to take the user back to the welcome landing page.
  2. Discord Server - Slash Commands Pertains to the commands entered within the server.
    • /help: Lists out all the different configuration commands for the bot.
    • /blacklist show: Shows the current blacklisted user/roles.
    • /blacklist add (user/role) Lets you add a specific user/role to a blacklist which makes them bypass the purges.
    • /blacklist remove (user/role): Lets you remove a specific user/role from the blacklist.
    • /purge: Starts a manual purge which will removed inactive users from server and send confirmation to specified channel.
    • /roletimer (role name) (amount of time in days): Sets the grace period for a certain role.
    • /setpurge (time in days): Sets the specified automated purge window (in days).
    • /timer (role) (time) Sets a time window (in days) for a role before considering them inactive.
    • /show inactivity: Shows members who are considered 'inactive' that are eligible to be purged.

Installation Steps

  • Using your Operating Systems Terminal set the ExecutionPolicy. Use the command: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser.

  • The RemoteSigned is also a safe PowerShell Execution policy to set in an enterprise environment. This policy dictates that any script that was not created on the system that the script is running on, should be signed. Therefore, this will allow you to write your own script and execute it. You would not be able to run a script that was downloaded from the Internet, or got from a friend who wrote it under his account or on a different computer. PowerShell differentiates between script you wrote on that computer, and a script that came from elsewhere using the file metadata.

  • (The scope makes the RemoteSigned only effect a single user instead of allowing all the users to become effected by the terminal command. This is a security precaution.)

  • Install Node.js. and its dependency Chocolatey.

  • [Removed: Initializing the bot manually is unnecessary with the current setup.]

  • Install nodemon using the terminal and the command npm install -g nodemon (nodemon installation allows the script to run continuously in the background while also autoupdating anytime script is changed in the bot project and saved allowing all changes to be quickly deployed for the bot).

  • Create a Discord bot on the Discord bot Discord Developer Portal.

  • Add the bot's token (Discord developer Portal-> application-> "specific app"-> bot -> Reset Token) to config.json and adjuste the configuration to indicate where the script is on your local machine.

  • Run the bot by using nodemon or nodemon index.js or any other command you prefer.

  • Add database token (Go to your MongoDB account. Under 'Database' select Clusters. Select the corresponding DB, Select the Connect button. Under 'Connect to your application', select Drivers. Follow the instructions to complete the setup and get the token for the database.)

  • Add guild id, in the Discord app, right-click on the Server Icon. Select copy Server ID.

    Updates 2024

  • cd into src active directing for all installations from here.

  • Install dotenv on using the terminal and the command npm install dotenv (This causes allows your bot project a place for the bots token to be stored later in the project and then be placed into a gitignore file in order to keep your token and other confidential project information safe if the bot is shared on GitHub.)

  • Install discord.js using the terminal and the command npm i discord.js.

  • Install express.js using the terminal and the command npm i express (Allows for a simple web server framework to handle requests received from the frontend app.)

  • Install mongoose using the terminal and the command npm i mongoose (Enables database integration with MongoDB so the app can read and write to the database.)

  • Install cors using the terminal and the command npm i cors

  • Install axios using the terminal and the command npm i axios (Allows front end to fetch data from the server for displaying in the UI.)

  • Install the react router dom using the terminal and the command npm i react-router-dom (Helps set up webpage routing on the server.)

  • Install react scripts using the terminal and the command npm i react-scripts --save

Setup Dotenv

  • In the src folder, create a new file named .env which will hold the:
    • TOKEN (your discord bot token)
    • databaseToken (your MongoDB token)
    • GUILD_ID (your server id)
    • CLIENT_ID (found on the discord developer portal -> click the hamburger -> OAUth2 -> Client Information)
    • CLIENT_SECRET (found on the discord developer portal -> click the hamburger -> OAUth2 -> Client Information)
    • REDIRECT_URI (found on the discord developer portal -> click the hamburger -> OAUth2 -> Redirects)

How To Run

  • From the src active directory, type npm start in the terminal and the bot, server, and react app will all start automatically. You will then see a login webpage appear in the browser automatically, presenting the admin login page for the dashboard.
  • In your IDE terminal you will see logs to aid in tracing how the code runs
  • In order to get past the admin login page, you must configure the .env with all the necessary fields

Neck Beard Team Roles

Sebastian Lian Carmagnola https://github.com/GGC-SD/DiscordBot.git

Sebastian

  1. Data Modeler πŸ‘Ύ
  2. Testing Lead ⌨️

Najee Douglas https://github.com/GGC-SD/DiscordBot.git

Najee

  1. UI/UX Design πŸ“
  2. Documentation Lead πŸ“œ

Etienne Laccruche https://github.com/GGC-SD/DiscordBot.git

ET

  1. Lead Programmer πŸ’»
  2. Client Liaison πŸ§‘β€πŸ€β€πŸ§‘

Jonathan Hummel

  1. Lead Programmer ⭐
  2. Team Manager πŸ΄β€β˜ οΈ

Project Flyer & Video

Discord Bot Flyer

Watch the demo video on YouTube

License

BashBot Β© 2024 by Sebastian L. Carmagnola, Najee Douglas, Etienne Laccruche, Jonathan Hummel, Anca Doloc Mihu, David Rivera, Mike Deiters is licensed under the MIT License. See the LICENSE file for details.

Spring 2025

πŸ“„ Description

Discord is an instant messaging and social platform where users can communicate through text, voice chat, and video calls. Our team has been tasked with fixing bugs and implementing new features to the purging Discord bot.

πŸ”— Links

  • Link to deployed project
  • Link to other resources

πŸ’» Technologies

  • JavaScript

πŸ’Ό Working Features

πŸ’Ύ Installation Steps

πŸƒ How To Run

πŸ‘Ύ CtrlAltKick Team

Abdou Senghore

  1. UI/UX Designer πŸ“±
  2. Client Liaison πŸ—£οΈ

Huyen Pham

  1. Data Modeler πŸ“
  2. Team Manager πŸ‘₯

Matilda Vazquez-Guzman

  1. Data Modeler βšͺ
  2. Documentation Lead πŸ“„

Nikki Thao

  1. Lead Programmer πŸ’»
  2. Testing Lead πŸ§ͺ

πŸ“½οΈ Project Flyer & Video

TBA

βœ… License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published