Closed amatsagu closed 11 months ago
PS: About execution logic. Every time client receives new interaction event - it'll fire "OnBefore" associated function, then depending on result it may stop or move to their regular handler. For example if we define OnBeforeCommandInteraction
function and it'll return true
- this command will never be realized, bot won't execute that command. All "OnAfter" callbacks will fire after main logic, idea for them is that you can place some cleaning or syncing logic there.
Edit: In case a command/component/modal logic would fail (and most likely result in panic), it will early terminate goroutine so defined "OnAfter" won't be triggered. You can potentially use that to easily check if slash command or modal finished executing properly.
Scrapped idea. Instead I've just added pre & post hook handlers for commands + added interfaces to customize used http server & mux.
There's idea to make Tempest lib be extendable by writing own, custom logic - aka plugins. Plan is to let anyone write own, reusable piece of code that could be later easily connected with any Tempest Discord Bot.
It will require some changes to current rest handler & client but once done - you'll have access to all client properties and incoming interaction events.
Example of how it could look like:
I would like to hear your opinions about it and suggestions how to best implement it.