node-telegram-bot-api-tutorial
node-telegram-bot-api-tutorial copied to clipboard
Is relocating of event listeners available?
Shortly:
Is it possible to move bot.onText
and others bot.on
event listeners to another JS file? Making some structure, when few related commands(even listeners) will be placed in one file, and another few - in another file, and finally include these commands into main script where bot initialized with something like mybot.useCommands(ModuleWithCommands1, Module2, Module3)
?
Full question is on StackOverflow: https://stackoverflow.com/questions/64318854/how-to-split-long-list-of-commands-to-different-files