ClemBot icon indicating copy to clipboard operation
ClemBot copied to clipboard

Add command to role cog to add role based on channel

Open jhollowe opened this issue 3 years ago • 6 comments

when in a channel with an associated role (from the class cog), the command (i.e. !role apply) would add the role for that class to the user who called the command.

For example: When I am in the cpsc-1010-teacher channel and run the command !role apply, I would receive the cpsc-1010 role

jhollowe avatar Aug 20 '20 15:08 jhollowe

This is a good idea, however with the current implementation of the class add command it's not necessarily an easy one. As the generated class role name can differ from the generated class channel name. Id prefer to avoid figuring out associations through string typing but it might be unavoidable.

Jay-Madden avatar Aug 20 '20 16:08 Jay-Madden

We could .split on dashes - but thats hacky and means we cant change stuff as easily in the future hmm

Jay-Madden avatar Aug 20 '20 16:08 Jay-Madden

could the class cog remember the channel to role mapping and the role cog ask the class cog for a lookup? idk how it is storing info, but that could be a way to do it at least for future added classes.

jhollowe avatar Aug 20 '20 16:08 jhollowe

ooooh. new idea. Add an emote to the init message that the class cog creates that you can click and get assigned that channel's role.

jhollowe avatar Aug 20 '20 16:08 jhollowe

it totally could, the problem is i didnt write a database component as i didnt at the time think it would be needed and it ups the complexity of the feature. Retroactivally adding it is possible but idk how wed associate the currently generated channels with a role, we could have an admin assoc command that would do that for us i suppose just run like

!class associate cpsc-1010 @cpsc-1010

Jay-Madden avatar Aug 20 '20 16:08 Jay-Madden

ooooh. new idea. Add an emote to the init message that the class cog creates that you can click and get assigned that channel's role.

this is another really good idea, tho the entry message is quickly hidden up top through conversation, the bot could pin it and that would work but thats pretty unclear and hidden. And then oc an entire service would need to be written to handle and reload that association

Jay-Madden avatar Aug 20 '20 16:08 Jay-Madden