- 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.
- JavaScript
- Node.js
Gabriel Kerven https://github.com/GGC-SD/DiscordBot.git
- Lead Programmer
- Client liasion :boom:
Alexis Pardo
- UI/UX Design βοΈ
- Testing lead π»
Ravjot Singh https://github.com/GGC-SD/DiscordBot.git
- Data Modeler
- Team Manager πββοΈ
Chidiebube Okebalama https://github.com/GGC-SD/DiscordBot.git
- Lead Programmer πΎ
- Documentation Lead π
- Discord
- Jira
- Progress tool Link
- 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.
- 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.
- Order 66 Β© 2023 by Gabriel Kerven, Chidiebube Okebalama, Alexis Pardo, Ravjot Singh, Anca Doloc Mihu, David Rivera, Mike Deiters is licensed under CC BY-ND 4.0
- 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.
-
JavaScript
-
React (https://react.dev/)
-
Material UI (https://mui.com/material-ui/)
-
Express.js (https://expressjs.com/)
-
MongoDB (https://www.mongodb.com/)
-
Dotenv (https://www.npmjs.com/package/dotenv)
- 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.
- 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.
-
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.
-
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
- 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)
- 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
Sebastian Lian Carmagnola https://github.com/GGC-SD/DiscordBot.git
- Data Modeler πΎ
- Testing Lead β¨οΈ
Najee Douglas https://github.com/GGC-SD/DiscordBot.git
- UI/UX Design π
- Documentation Lead π
Etienne Laccruche https://github.com/GGC-SD/DiscordBot.git
- Lead Programmer π»
- Client Liaison π§βπ€βπ§
Jonathan Hummel
- Lead Programmer β
- Team Manager π΄ββ οΈ
Watch the demo video on YouTube
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.
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.
- Link to deployed project
- Link to other resources
- JavaScript
- UI/UX Designer π±
- Client Liaison π£οΈ
- Data Modeler π
- Team Manager π₯
- Data Modeler βͺ
- Documentation Lead π
- Lead Programmer π»
- Testing Lead π§ͺ
TBA