Sha256: 8c6f63bc70fa41855a75cec4d96909058018939c02e6990a87b46aadec0d6bab

Contents?: true

Size: 754 Bytes

Versions: 2

Compression:

Stored size: 754 Bytes

Contents

require 'telegram_bot/url'
require 'telegram_bot/reply/request'

module Telegram
  module Reply

    def send_message(chat_id: @chat.id, text:, parse_mode: 'html', **options)
      url     = Telegram::URL::SEND_MESSAGE
      params  = {
                  chat_id: chat_id,
                  text: text,
                  parse_mode: parse_mode,
                  disable_web_page_preview: options[:disable_web_page_preview].presence,
                  disable_notification: options[:disable_notification].presence,
                  reply_to_message_id: options[:reply_to_message_id].presence,
                  reply_markup: options[:reply_markup].presence
                }
      
      Telegram::Reply::SEND(url: url, params: params)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tg-bot-0.0.2 lib/telegram_bot/reply/send_message.rb
tg-bot-0.0.1 lib/telegram_bot/reply/send_message.rb