Class: Kanal::Interfaces::Telegram::Helpers::TelegramLinkParser

Inherits:
Object
  • Object
show all
Defined in:
lib/kanal/interfaces/telegram/helpers/telegram_link_parser.rb

Instance Method Summary collapse

Instance Method Details



8
9
10
11
12
# File 'lib/kanal/interfaces/telegram/helpers/telegram_link_parser.rb', line 8

def get_file_link(file_id, bot, bot_token)
  file = bot.api.get_file(file_id: file_id)
  file_path = file.dig('result', 'file_path')
  "https://api.telegram.org/file/bot#{bot_token}/#{file_path}"
end