telegram-bot-ruby icon indicating copy to clipboard operation
telegram-bot-ruby copied to clipboard

method get chat member not found

Open mm580486 opened this issue 7 years ago • 1 comments

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:inblock (2 levels) in

': undefined method 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

mm580486 avatar Oct 21 '17 15:10 mm580486

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.

ivanovaleksey avatar Oct 21 '17 16:10 ivanovaleksey

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.

github-actions[bot] avatar Feb 19 '23 15:02 github-actions[bot]