Class: SpreeCmCommissioner::TelegramNotificationSender
- Inherits:
-
BaseInteractor
- Object
- BaseInteractor
- SpreeCmCommissioner::TelegramNotificationSender
- Defined in:
- app/interactors/spree_cm_commissioner/telegram_notification_sender.rb
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/interactors/spree_cm_commissioner/telegram_notification_sender.rb', line 5 def call telegram_client.( chat_id: chat_id, parse_mode: parse_mode, text: ) rescue ::Telegram::Bot::Error => e (e.to_s) end |
#notifier_error_message(error_message) ⇒ Object
19 20 21 22 23 24 |
# File 'app/interactors/spree_cm_commissioner/telegram_notification_sender.rb', line 19 def () ::Telegram.bots[:exception_notifier].( chat_id: chat_id, text: "Telegram Notifier Error:\n#{}\nSend Text:\n#{}" ) end |
#telegram_client ⇒ Object
15 16 17 |
# File 'app/interactors/spree_cm_commissioner/telegram_notification_sender.rb', line 15 def telegram_client context.telegram_client ||= ::Telegram.bots[:default] end |