atipugin / telegram-bot-ruby

Ruby wrapper for Telegram's Bot API
https://core.telegram.org/bots/api
Do What The F*ck You Want To Public License
1.35k stars 217 forks source link

ArgumentError if message is not a string #262

Closed Evillemonpie closed 1 year ago

Evillemonpie commented 1 year ago

Hello, I am new to programming. I have a simple code as in the example from the documentation: require 'telegram/bot'

token = 'YOUR_TELEGRAM_BOT_API_TOKEN'

Telegram::Bot::Client.run(token) do |bot|
  bot.listen do |message|
    case message.text
    when '/start'
      bot.api.send_message(chat_id: message.chat.id, text: "Hello, #{message.from.first_name}")
    when '/stop'
      bot.api.send_message(chat_id: message.chat.id, text: "Bye, #{message.from.first_name}")
    end
  end
end

when I send a sticker or photo to chat with bot I get an error .../virtus/attribute/collection.rb:9:in `initialize': wrong number of arguments (given 0, expected 1..3) (ArgumentError)

denisgorbunov commented 1 year ago

same error

atipugin commented 1 year ago

Unfortunately I unable reproduce your error. Code from example/bot.rb works just fine for me. Do you most recent version of gem (0.21.1)?

Evillemonpie commented 1 year ago

I used version 0.21.0, updating to 0.21.1 solved the problem. ty