Conditional roles #6

Open
opened 2022-08-10 01:41:04 +02:00 by myrkvi · 7 comments
myrkvi commented 2022-08-10 01:41:04 +02:00 (Migrated from github.com)

Roles that are added to or removed from users based on a certain condition.

In NLL, there's currently only one instance of this: The "in-voice" role which is given to users that are in a voice channel, giving access to the NSFW voice text channel.

Roles that are added to or removed from users based on a certain condition. > In NLL, there's currently only one instance of this: The "in-voice" role which is given to users that are in a voice channel, giving access to the NSFW voice text channel.
Owner

Any idea how that should work?
Just listening for specific events to accure and adding roles then?

Any idea how that should work? Just listening for specific events to accure and adding roles then?

The bot would listen for events, then check against the database if it matches any criteria to assign or unassign a role.

On the admin side we would need commands for adding and removing criteria and their roles.

The bot would listen for events, then check against the database if it matches any criteria to assign or unassign a role. On the admin side we would need commands for adding and removing criteria and their roles.
Owner

What format do you think? Some custom "language" for the rules?

What format do you think? Some custom "language" for the rules?

Database-wise, I'd say one row per rule. Perhaps something like this

CREATE TABLE ConditionalRoles (
	id INTEGER PRIMARY KEY AUTOINCREMENT,
    guild_id INTEGER NOT NULL,
    condition_type VARCHAR(24) NOT NULL,
    condition_constraint TEXT,
);

condition_constraint will likely be some JSON data or similar?
Or we could do it the proper relational way and add another table for constraints :dogehehe:

Could be managed via commands. Could have different sub-commands if we add multiple types of conditions

Database-wise, I'd say one row per rule. Perhaps something like this ```sql CREATE TABLE ConditionalRoles ( id INTEGER PRIMARY KEY AUTOINCREMENT, guild_id INTEGER NOT NULL, condition_type VARCHAR(24) NOT NULL, condition_constraint TEXT, ); ``` `condition_constraint` will likely be some JSON data or similar? Or we could do it the proper relational way and add another table for constraints :dogehehe: Could be managed via commands. Could have different sub-commands if we add multiple types of conditions
Owner

So sth like an enum of types and constraints as objects?

So sth like an enum of types and constraints as objects?
Owner

I could read a bit more about different options. I can even make a graph database if that makes it any easier. 🤔

I could read a bit more about different options. I can even make a graph database if that makes it any easier. 🤔

So sth like an enum of types and constraints as objects?

Yeah, something like that!

I could read a bit more about different options. I can even make a graph database if that makes it any easier. 🤔

I've been considering using SurrealDB :p

> So sth like an enum of types and constraints as objects? Yeah, something like that! > I could read a bit more about different options. I can even make a graph database if that makes it any easier. 🤔 I've been considering using SurrealDB :p
Sign in to join this conversation.
No description provided.