-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error on photo sending (400) #32
Comments
Same here. Sending photos does not work anymore. This happened after updating all gems. Output of
|
Same here. I'm getting a different error but it happens when sending photo/documents.
Every gem is up-to-date. EDIT: just to be sure, same behavior happens with example code and on two different machines on two far away networks. |
I solved the problem for myself (telegram-bot-ruby 0.4.0) as follows: class Telegram::Bot::Api
private
def jsonify_inline_query_results(value)
return value unless value.class == Array
return value unless Array(value).all? { |i| INLINE_QUERY_RESULT_TYPES.include?(i.class) }
value.map { |i| i.to_h.select { |_, v| v } }.to_json
end
end |
@zeracode yeah, the issue was exactly here, thanks. I've released 0.4.1 with fix. Please update the gem. |
Same issue here, I have v0.5.2 |
Please show your code. |
Alright after looking for other closed issue it appears that we have to use now the Faraday::UploadIO.new instead of File.new which caused the issue in a code that was running just fine before. |
It is highlighted in README. |
My bot can't send a photo.
It sticks on "BeforeResponse" stage. Then after 1-2 minutes console says:
/home/vova/.rvm/gems/ruby-2.2.1/gems/telegram-bot-ruby-0.4.0/lib/telegram/bot/api.rb:49:in `call': Telegram API has returned the error. (ok: "false", error_code: "400", description: "[Error]: Bad Request: Wrong persistent file_id specified: contains wrong characters or have wrong length"(Telegram::Bot::Exceptions::ResponseError)
The text was updated successfully, but these errors were encountered: