You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All the commands are currently defined in a single file (bot.ts), which is not modular and makes it hard to keep up. The definition of the commands should be splitted in multiple files in the commands folder. Commands should exhibit a similar interface.
Common mother class should specify
name, description, usage
if command is private only or not
have a method to check the validity of the request
have a method to process the request
Ideally, a mother class should define additional pre-operations and post-operations to be performed before and after the processing of the command (to allow to filter users or validate parameters).
The text was updated successfully, but these errors were encountered:
Could use Inversify and extract each command behaviour in a dedicated Command class.
The Telegram bot would only register commands and provides it a way to communicate with the outside.
This way, it makes it easier to add a new command (simply add the related Command class and register it as a command for the bot) or to add a new platform (other than Telegram), since the separation between the commands and the bots is more clear. It would simply require to define a new service (as for Telegram) and register the commands on it (of course, a dedicated user class should be done, linked to the existing wallets).
All the commands are currently defined in a single file (bot.ts), which is not modular and makes it hard to keep up. The definition of the commands should be splitted in multiple files in the commands folder. Commands should exhibit a similar interface.
Common mother class should specify
Ideally, a mother class should define additional pre-operations and post-operations to be performed before and after the processing of the command (to allow to filter users or validate parameters).
The text was updated successfully, but these errors were encountered: