cronokirby / alchemy

A discord library for Elixir
MIT License
152 stars 34 forks source link

Cog/command predicates #97

Open khionu opened 4 years ago

khionu commented 4 years ago

I would like to have the same functionality as in Discord.Py, where you can create a condition that is evaluated before the command arguments are parsed. This should be usable to add checks for the whole Cog and for individual commands.

cronokirby commented 4 years ago

So this condition would have access to the message, I assume. Anything else? (not familiar with how discord.py) works. It could work similar to how Cogs.set_parser works atm. You could do Cogs.cond or something like that

khionu commented 4 years ago

Message and possibly user's configuration. To cover all use cases, you need to be able to obtain all contextual information (Channel/Guild/User), which includes any settings that were set by the bot's user that might affect availability of a given command.