1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-04 02:05:52 +03:00
Этот коммит содержится в:
Max Melentiev
2016-03-14 14:19:57 +06:00
родитель 225290b677
Коммит c04884040d
4 изменённых файлов: 20 добавлений и 2 удалений

Просмотреть файл

@@ -19,6 +19,9 @@ module Telegram
when Hash then
input = input.stringify_keys
new input['token'], input['username']
when Symbol
Telegram.bots[input] or
raise "Bot #{input} not configured, check Telegram.bots_config."
else
new(input)
end

Просмотреть файл

@@ -42,7 +42,9 @@ module Telegram
# # You can override this options or specify others:
# telegram_webhooks TelegramController, as: :my_webhook
# telegram_webhooks bot => [TelegramChatController, as: :chat_webhook],
# other_bot => [TelegramAuctionController,
# other_bot => TelegramAuctionController,
# admin_chat: TelegramAdminChatController
#
def telegram_webhooks(controllers, bots = nil, **options)
unless controllers.is_a?(Hash)
bots = bots ? Array.wrap(bots) : Telegram.bots.values