Class: TelegramSupportBot::Adapters::Base
- Inherits:
-
Object
- Object
- TelegramSupportBot::Adapters::Base
show all
- Defined in:
- lib/telegram_support_bot/adapters/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(**options) ⇒ Base
Returns a new instance of Base.
9
10
11
12
|
# File 'lib/telegram_support_bot/adapters/base.rb', line 9
def initialize(**options)
@options = options
setup(options)
end
|
Instance Attribute Details
#bot ⇒ Object
Returns the value of attribute bot.
7
8
9
|
# File 'lib/telegram_support_bot/adapters/base.rb', line 7
def bot
@bot
end
|
Instance Method Details
#forward_message(from_chat_id:, chat_id:, message_id:) ⇒ Object
34
35
36
|
# File 'lib/telegram_support_bot/adapters/base.rb', line 34
def forward_message(from_chat_id:, chat_id:, message_id:)
end
|
#on_message(&block) ⇒ Object
38
39
40
|
# File 'lib/telegram_support_bot/adapters/base.rb', line 38
def on_message(&block)
end
|
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/telegram_support_bot/adapters/base.rb', line 22
def send_media(chat_id:, type:, media:, **options)
method = "send_#{type}"
args = { chat_id: chat_id, **options }
args[type] = media
if respond_to?(method, true)
send(method, **args)
else
raise ArgumentError, "Unsupported media type: #{type}"
end
end
|
#send_message(chat_id:, text:) ⇒ Object
18
19
20
|
# File 'lib/telegram_support_bot/adapters/base.rb', line 18
def send_message(chat_id:, text:)
end
|
#setup(options) ⇒ Object
14
15
16
|
# File 'lib/telegram_support_bot/adapters/base.rb', line 14
def setup(options)
end
|