Hi Guys Im try to send media grp with my

bot. But it cant seem to read file1 and file2 of the below sample code i found on the net. I suspect something abt the faraday im doing it wrong. Can someone help? How to use faraday?

bot.api.send_media_group(
chat_id: message.chat.id,
media: [
Telegram::Bot::Types::InputMediaPhoto.new(media: 'attach://file1'),
Telegram::Bot::Types::InputMediaPhoto.new(media: 'attach://file2')
],
file1: Faraday::UploadIO.new('/path/to/file1.png', 'image/png'),
file2: Faraday::UploadIO.new('/path/to/file2.png', 'image/png')
)

5 ответов

19 просмотров
Anton- Автор вопроса

Im using telegram bot ruby gem btw

Anton- Автор вопроса

Anyone?

Anton- Автор вопроса

anyone?

if($text == '/send'){ bot("sendMediaGroup",[ "chat_id"=>$cid, "media"=>json_encode([ ["type"=>"photo", "media" => "URL"], ["type"=>"photo", "media" => "URL"], ]), 'caption'=>"caption", 'parse_mode'=>"html"])])}

Похожие вопросы

Карта сайта