ESN-Trondheim / ESNbot

A Slack bot for ESN Trondheim
MIT License
3 stars 1 forks source link

Add support for admin only commands #67

Open LaiAlexander opened 10 months ago

LaiAlexander commented 10 months ago

There's already support for hidden commands (when #36 is merged into master, that is), but it would be nice to have support for commands that are only accessible by workspace admins (and owners). This could be done with an is_admin() decorator, or the functionality could be added into the already exisiting decorator register_command().

Probably cleanest and easiest to use a separate decorator for this, then the deocorators have their own responsibility instead of one that does everything.

The responses from admin only commands should probably always be ephemeral, in case of sensitive and/or secret info. Could also require a dm for being able to invoke the commands, but that doesn't feel like the best solution. A this possibility is that the responses always comes via dm, through this feels clunky I think.