nminaya / grammar-nazi-bot

Bot that corrects spelling mistakes.
MIT License
31 stars 8 forks source link

Move telegram bot command handler logic #16

Closed nminaya closed 4 years ago

nminaya commented 4 years ago

We need to move into a separate class all the logic inside TelegramBotHostedService.HandleCommand method, so that it will be easier to test. https://github.com/nminaya/grammar-nazi-bot/blob/d84df8519226ad899d8bb58a070bedf79876438a/GrammarNazi.App/HostedServices/TelegramBotHostedService.cs#L144

Create a ITelegramCommandHandler with the following signature:

Task HandleCommand(ITelegramBotClient client, Message message);

The implementation of this method should be the same as in TelegramBotHostedService.HandleCommand.

After the creation of the implementation of this new ITelegramCommandHandler, the TelegramBotHostedService.HandleCommand method should be removed and use the ITelegramCommandHandler.HandleCommand instead.

Jadhielv commented 4 years ago

I would like to help you with this @nminaya

nminaya commented 4 years ago

@Jadhielv Sure, go ahead!