xooniverse / televerse

Your gateway to seamless Telegram Bot Development 💙
https://televerse.xooniverse.com
BSD 3-Clause "New" or "Revised" License
65 stars 11 forks source link

Bot initialized with `Bot.init` cannot use Conversation #294

Closed HeySreelal closed 2 months ago

HeySreelal commented 2 months ago

Bot.init doesn't initializes the stream controllers, hence crashing with the null error on the following line:

https://github.com/xooniverse/televerse/blob/b88ce467219086c5050a495659e35880d272152c/lib/src/televerse/fetch/fetch.dart#L23

Error and Stack Trace:

‼️ An error occurred while processing the update.
Null check operator used on a null value
#0      Fetcher.onUpdate (package:televerse/src/televerse/fetch/fetch.dart:23:55)
#1      Bot.updatesStream (package:televerse/src/televerse/bot/bot.dart:631:20)
#2      Conversation.waitFor (package:televerse/src/televerse/conversation/conversation.dart:468:25)
<asynchronous suspension>
#3      Conversation.waitForTextMessage (package:televerse/src/televerse/conversation/conversation.dart:143:12)
<asynchronous suspension>
#4      findHandler (package:veyilapi/bot/handlers/find.dart:24:9)
<asynchronous suspension>
#5      Bot._processUpdate (package:televerse/src/televerse/bot/bot.dart:329:9)
<asynchronous suspension>
#6      Bot._onUpdate.<anonymous closure> (package:televerse/src/televerse/bot/bot.dart:401:11)
<asynchronous suspension>
#7      Bot._applyMiddlewares.next (package:televerse/src/televerse/bot/bot.dart:442:11)
<asynchronous suspension>
#8      Bot._applyMiddlewares (package:televerse/src/televerse/bot/bot.dart:450:5)
<asynchronous suspension>
#9      Bot._onUpdate (package:televerse/src/televerse/bot/bot.dart:400:9)
<asynchronous suspension>