Sha256: 39115a25508038a2fe6e8f7e4de3555316bf55171dbbf8a143be1800056a2d64

Contents?: true

Size: 428 Bytes

Versions: 9

Compression:

Stored size: 428 Bytes

Contents

# frozen_string_literal: true

module Kanal
  module Interfaces
    module Telegram
      module Helpers
        class TelegramLinkParser
          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
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
kanal-interfaces-telegram-0.4.2 lib/kanal/interfaces/telegram/helpers/telegram_link_parser.rb
kanal-interfaces-telegram-0.4.1 lib/kanal/interfaces/telegram/helpers/telegram_link_parser.rb
kanal-interfaces-telegram-0.4.0 lib/kanal/interfaces/telegram/helpers/telegram_link_parser.rb
kanal-interfaces-telegram-0.3.6 lib/kanal/interfaces/telegram/helpers/telegram_link_parser.rb
kanal-interfaces-telegram-0.3.5 lib/kanal/interfaces/telegram/helpers/telegram_link_parser.rb
kanal-interfaces-telegram-0.3.4 lib/kanal/interfaces/telegram/helpers/telegram_link_parser.rb
kanal-interfaces-telegram-0.3.3 lib/kanal/interfaces/telegram/helpers/telegram_link_parser.rb
kanal-interfaces-telegram-0.3.2 lib/kanal/interfaces/telegram/helpers/telegram_link_parser.rb
kanal-interfaces-telegram-0.3.1 lib/kanal/interfaces/telegram/helpers/telegram_link_parser.rb