xooniverse / televerse

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

Fix bug when running bot locally #272

Closed devsdocs closed 2 months ago

devsdocs commented 2 months ago

When running using Bot.local, it keep fetch api.telegram.org, this will fix it.

HeySreelal commented 2 months ago

Hey, thanks for looking into this. I just did some checks on my end as well.

The only change actually required was to change this line:

https://github.com/HeySreelal/televerse/blob/6c9028bec39f580f516f15f17d6f0bfd7efa5339/lib/src/televerse/bot/bot.dart#L242

To this one - because the api getter does all the work implicitly to create a RawAPI instance.

fetcher.setApi(api);

Just a side note: we didn't had to initialize the _api instance in the Bot's constructor at all.

https://github.com/HeySreelal/televerse/blob/6c9028bec39f580f516f15f17d6f0bfd7efa5339/lib/src/televerse/bot/bot.dart#L159


Being said that thank you so much for the contribution ❤️, if you're sitting on this please let me know. We can close this PR and switch to a new one with the right changes.

HeySreelal commented 2 months ago

So basically, changes needed are:

  1. Remove the line L#159 https://github.com/HeySreelal/televerse/blob/6c9028bec39f580f516f15f17d6f0bfd7efa5339/lib/src/televerse/bot/bot.dart#L159
  2. Update line L#242 https://github.com/HeySreelal/televerse/blob/6c9028bec39f580f516f15f17d6f0bfd7efa5339/lib/src/televerse/bot/bot.dart#L242 To: fetcher.setApi(api);

It should work just fine. Please let me know if you're on this :)

HeySreelal commented 2 months ago

Hey, don't worry. I've made those mentioned changes. I'll quickly release a new version along with Bot API 7.7 :)

Thanks for reporting the issue ❤️