This is more a design/architecture question. Just need more input.
So, a few of the commands I am writing for my bot are getting… complicated. By that I mean, database state is being updated, which leads to server categories being updated, and channels being updated, etc…So, instead of putting all the logic in my command class, I decided to go the event emitter route and
this.container.client.emit()
this.container.client.emit()
route and move the server channel/category/role updating to a listener that just responds to the custom event I emitted.
Something that crosses my mind though is how to handle if one of the listeners fail for whatever reason.
Does Sapphire provide an option to automatically retry listeners if they fail? Or am I gonna need to manually handle that somehow?
Solution
There's retry package by sapphire which can ease your retry attempts.
But you have to manually handle the errors & retry attempts