Closed kevinthedang closed 3 days ago
One idea here is to use the roles feature to issue roles for certain permissions to each user that may need one or want one. This can be an admin-level slash command.
@JT2M0L3Y
Referring #13 as it should also include this because of the Redis dependency we are likely adding for performance and storage.
Thoughts:
@JT2M0L3Y
Update:
We could store the entire contents of the aforementioned JSON file as a value in Redis and link it to a "user preferences" key.
However, this means we would be caching a new set of user preferences for the entire server and calling the entire JSON each time we update or check for a user preference.
My Idea for a new approach, have a configs.json
file and store everything there for now... or we create separate files to support the Redis caching we plan on doing.
My initial thoughts:
export interface UserConfiguration {
'message-stream'?: boolean,
'message-style'?: boolean,
'modify-capacity': number
}
export interface ServerConfiguration {
'toggle-chat'?: boolean,
'channel-toggle'?: boolean
}
/**
* Parent Configuration interface
*
* @see serverOptions server settings per guild
* @see userConfigurations user configurations (only for the user for any server)
*/
export interface Configuration {
readonly name: string
serverOptions: {
[guildId: string]: ServerConfiguration
},
userConfigurations: {
[username: string]: UserConfiguration
}
}
The Redis plan would look similar, but instead of 1 file, it's just multiple files for users and servers (or 1 file for servers idk). This allows the bot to be compatible for multiple servers with their own settings and for users having their own settings.
@JT2M0L3Y
I only have one concern, about the definition of each configuration.
modify-capacity
require a user to set it? (there's a default capacity, if I remember correctly)toggle-chat
be optional?@JT2M0L3Y
For now I will develop them separately:
If you have any other questions just let me know.
@JT2M0L3Y
Issue
Solutions
server_name.json
for that servers configurations in aconfig/
folder.