telegram-bot-ruby
telegram-bot-ruby copied to clipboard
method get chat member not found
hi guys
i want check a channel if user joined to channel user can be continue to use bot i found this example on this issue https://github.com/atipugin/telegram-bot-ruby/issues/124
def get_chat_member resp = BOT.api.get_chat_member(chat_id: "@caffe_fan", user_id: message.from.id) return unless resp['ok'] member = Telegram::Bot::Types::ChatMember.new(resp['result']) //<Telegram::Bot::Types::ChatMember:0x007febce2a55a0 @user=#<Telegram::Bot::Types::User:0x007febce2a4010 @id=xxxxxxxxx, @first_name="Aleksey", @username="", @last_name=nil>, @status="member"> // do something here end
but this code return this error
bot.rb:31:in
block (2 levels) in get_chat_member' for Telegram::Bot::Api:Class (NoMethodError) from /Users/mac/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/telegram-bot-ruby-0.3.11/lib/telegram/bot/client.rb:41:in
block in fetch_updates'
`
please help me to fix this error oy another way to check user on channel thanks
According to error message you are using 0.3.11 version. Current version is 0.8.4. I think updating the gem would solve the issue.
Also please use ``` for multiline code formatting.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.