-
Notifications
You must be signed in to change notification settings - Fork 1
Commands / Permission Page #163
Comments
the commands page right now is not working properly? |
What if we just changed the schema and the way permissions for commands work at the moment to be separate in the schema instead of all of it being in 1 array. So instead of
This would mean we don't need to manipulate the stager at all. Remember the commands are probably the only thing that remains that is an array of objects in the rewrite atm. Everything else that is NOT a setting was decided to be moved to separate tables instead of filling the Settings up. @pedall @PierreAndreis |
Isn't |
Every guild has an empty commands: [
{
name: 'ping', // Name of the command
msgDelete: true, // Whether to delete the command trigger message
permission: {
disabled: true, // Whether the command is allowed on the server
disabledChannels: [], // Channels that do not allow this command
disabledRoles: ["ROLE ID"], // Roles not allowed to use this command
enabledChannels: [], // Channels that are allowed if disabled: true
enabledRoles: [], // Roles allowed to used if disabled: true
}
}
] So whenever a command is edited an object like this is thrown into that array. If an object does not exist it takes the default settings. So whenever you edit a command permission an object like this gets added to the array. @PierreAndreis |
@Skillz4Killz that's a good design, I like it. We just need to pass the defaults to the dashboard and teach Stager how to handle arrays |
There is already a commands page, currently commented out in the router.js, where all the permission regarding the commands can be set. To be able to have the commands page working properly we need the following:
Data Logic
Get all current command settings from bot (already fetched anyway) and merge those with the default command settings (to be able to show all commands - also already done on the api)
Reflect changes in the command permissions (enable / disable, deletion trigger on / off, exceptions for channels / roles)
Remove commands from array that are the default, and save final commands array to the database (current settings will be overwritten as the whole array will be overwritten)
Component dependencies
The text was updated successfully, but these errors were encountered: