telegram-bot-rb / telegram-bot

Ruby gem for building Telegram Bot with optional Rails integration
MIT License
633 stars 113 forks source link

"save_context" method is not working properly in group chat #215

Closed Nmerey closed 4 months ago

Nmerey commented 11 months ago

When using Poller mode, save_context does not trigger passed method when used in group chat but works in bot's chat.

Below is when used in group chat: image

It does not fetch updates: image

When used in bot's chat save_context triggers get_location method passed to it: image

It does fetch updates: image

Questions:

  1. May it be because of group chat id?
  2. Or some new restrictions about fetching updates in Telegram?(Could not find any info about that)
printercu commented 11 months ago

Context is based on session. See how to configure session key in docs https://github.com/telegram-bot-rb/telegram-bot#session

By default it only uses user id: https://github.com/telegram-bot-rb/telegram-bot/blob/master/lib/telegram/bot/updates_controller/session.rb#L33