Class: SpreeCmCommissioner::TelegramStartMessageSender

Inherits:
BaseInteractor
  • Object
show all
Defined in:
app/interactors/spree_cm_commissioner/telegram_start_message_sender.rb

Instance Method Summary collapse

Instance Method Details

#callObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/interactors/spree_cm_commissioner/telegram_start_message_sender.rb', line 7

def call
  client = ::Telegram::Bot::Client.new(telegram_bot.token)
  client.send_photo(
    chat_id: chat_id,
    caption: telegram_bot.preferred_start_caption,
    photo: url_for(telegram_bot.start_photo),
    reply_markup: {
      inline_keyboard: [
        [{ text: telegram_bot.preferred_start_button_text, url: telegram_bot.preferred_start_button_url }]
      ]
    }.to_json
  )
end