ClemBotProject / ClemBot

A Discord bot for server management with an emphasis on modularity and configuration. If you have an idea or a feature you would like to contribute feel free to open an issue and we as a community can begin discussion.
https://clembot.io
MIT License
82 stars 57 forks source link

Add command to role cog to add role based on channel #153

Open jhollowe opened 4 years ago

jhollowe commented 4 years ago

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

Jay-Madden commented 4 years ago

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 commented 4 years ago

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

jhollowe commented 4 years ago

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 commented 4 years ago

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.

Jay-Madden commented 4 years ago

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 commented 4 years ago

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