MajMcCloud / TelegramBotFramework

This is a context based application framework for the C# TelegramBot library.
https://www.t.me/tgbotbase
MIT License
149 stars 43 forks source link

Exception on Calling InvokeMessageLoop on DefaultMessageLoop when there is no "userevent" #26

Closed palashjhabak closed 2 years ago

palashjhabak commented 2 years ago

https://github.com/MajMcCloud/TelegramBotFramework/blob/3340ef7b76c90c8971deec92c68f668aa5a79782/TelegramBotBase/Factories/MessageLoops/FormBaseMessageLoop.cs#L29

Because when there is no "userevent" ur.RawData is null and hence update.Type is null and the code throws an exception on Invoking the Message Loop manually without a user event

MajMcCloud commented 2 years ago

Hey!

thanks for getting back about this. I will take a look how we can solve this the "easy way". Will get back to this inside this ticket in the next days.

Warm regards Florian

palashjhabak commented 2 years ago

@MajMcCloud For now as a workaround, I have called the Form render method explicitly but I don't think that's a proper solution as everything should go through the message loop only.

MajMcCloud commented 2 years ago

I made a simple fix for this on the development branch. An updated nuget package 5.1.2-alpha will be available in the next minutes.

palashjhabak commented 2 years ago

Awesome. Thanks a lot.