Discord -> Roblox moderation system.
This system only enables discord-to-roblox moderation, it's up to you to implement roblox-to-roblox systems.
Much bigger implementations are planned including:
- Updating the codebase with more commands for utility usage (Like checking server data, server fps, server uptime, etc.)
- Cleaning up of the entire codebase cause it is very messy 💀
- Sorting the roblox-client side code allowing scripters to easily implement additional systems
- Web connections are socket-like
- A lot of systems seen may take significantly long amounts of time to execute commands on roblox, or may exhaust their HTTP calls, disro uses long polling to maintain connections for as long as possible, making sure resources aren't wasted, simultaneously assuring: 1. Near-instant command execution 2. No exhaustive HTTP calls
- Discord bot framework makes it easy to use
- Takes minutes to set up
- Flexible to use on large scale games
# Clone this project
git clone https://github.com/Zidaan-Hayat/disro.git
# Go into the directory
cd disro
# Install the required dependencies (from the package.json)
npm install
Edit the config.json
file.
{
"botToken": "The bot token given from your application",
"botPrefix": "The prefix all your bot commands will use",
"ownerId": "Bot owner discord ID (As a string [wrapped in quotes] not as an integer!)",
"serverApiKey": "The API key for your server to communicate with the roblox client, can be any random generated string",
"moderationRoleId": "The role ID that is required to run game moderation commands, if it's an empty string only game owners will be able to use commands"
}
Copy all files in the roblox/
folder, into a location in your ServerScriptService
The only thing you need to make sure is that the files share the same Parent (Folder, etc.)
<>
Indicates a required argument
[]
Indicates an optional argument
Find the server a player is currently in (if they're in any)
With server ID: Get a list of all the players in the server
Without server ID: Get a list of all the current game servers
Kick a player from the server they're currently in
Ban a player from the game entirely and if they're in a server, kick them
Unban a player from the entire game
Why did you implement rbxwebhook.js in your code instead of installing the dependency?
The dependency manages client connections by assigning a random UUID, for this system to be a little easier to use, I assign each connection the ID of the server it's connected to. I'm yet to make a pull request for this to the dependency.
A datastore named "bans" is created and entries are written directly into that datastore with the entry keys being the target user ID and the value being the ban reason
The module to handle all this is in roblox/banStore
Go to roblox/modFunctions
and you can adjust/re-do the "handleBan" function as you wish
This project is nothing without the blood, sweat and tears of other dependencies. The listed projects severely assisted the creation of this system and are depended on within the code someway or another.
Their code repositories are listed below:
- Axios
- Discord.js-commando
- Express
- rbxwebhook.js (Custom implementation was made but the essence of the discord -> robox communication is directly from this project)
I do not have a discord server for this since it's a very weeny project, so if you have any suggestions please slap me a friend request on Discord (Zz#7940) and you can talk to me directly from there :D