1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-08 03:45:52 +03:00

Ability to use type-castion with telegram-bot-types

Этот коммит содержится в:
Max Melentiev
2016-02-23 14:11:55 +06:00
родитель 00a2e3ba8d
Коммит a1adf17df3
24 изменённых файлов: 392 добавлений и 200 удалений

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

@@ -1,7 +1,8 @@
require 'telegram/bot'
require 'active_support/core_ext/array/wrap'
module Telegram
class Bot
module Bot
module RoutesHelper
class << self
# Returns route name for given bot. Result depends on `Telegram.bots`.
@@ -42,7 +43,7 @@ module Telegram
controllers = Hash[bots.map { |x| [x, controllers] }]
end
controllers.each do |bot, controller|
bot = Bot.wrap(bot)
bot = Client.wrap(bot)
controller, bot_options = controller if controller.is_a?(Array)
params = {
to: Middleware.new(bot, controller),