telebot
telebot copied to clipboard
Multi-layered events(sub-events)
Is it possible to implement multi-layered event system? What i mean is to separate each event-layer by "." character and be able to use upper layer as middleware. For example:
bot.on('some_event', (msg) => {
//do something
next();
})
bot.on('some_event.sub_event', (msg) => {
//do something again
});
For now I have found this solution:
bot.on('some_event', (msg) => {
//do something
bot.event(`some_event.${msg.sub_event_name}`, msg);
})
Yep, you can make chains. Are you satisfied with this solution?
Yeah, it is working fine for me, but are you planning to add this feature in future?