kevinthedang / discord-ollama

Discord Bot that utilizes Ollama to interact with any Large Language Models to talk with users and allow them to host/create their own models.
Creative Commons Attribution 4.0 International
42 stars 4 forks source link

User Preferences vs Server Preferences #36

Closed kevinthedang closed 3 days ago

kevinthedang commented 3 months ago

Issue

Solutions

JT2M0L3Y commented 3 months 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.

kevinthedang commented 2 months ago

@JT2M0L3Y

Referring #13 as it should also include this because of the Redis dependency we are likely adding for performance and storage.

kevinthedang commented 1 month ago

Thoughts:

@JT2M0L3Y

JT2M0L3Y commented 1 month ago

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.

kevinthedang commented 6 days ago

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

JT2M0L3Y commented 6 days ago

I only have one concern, about the definition of each configuration.

kevinthedang commented 5 days ago
  1. No. It will always default to 5 for performance's sake.
  2. I mean we can. If you want?

@JT2M0L3Y

kevinthedang commented 5 days ago

For now I will develop them separately:

  1. User Preferences file
  2. Server Preferences file

If you have any other questions just let me know.

@JT2M0L3Y