1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-05 18:45:51 +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 удалений

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

@@ -2,8 +2,10 @@ require 'abstract_controller'
require 'active_support/callbacks'
module Telegram
class Bot
module Bot
class UpdatesController < AbstractController::Base
abstract!
include AbstractController::Callbacks
include AbstractController::Translation
@@ -11,6 +13,8 @@ module Telegram
require 'telegram/bot/updates_controller/instrumentation'
prepend Instrumentation
autoload :TypedUpdate, 'telegram/bot/updates_controller/typed_update'
PAYLOAD_TYPES = %w(
message
inline_query
@@ -18,7 +22,6 @@ module Telegram
).freeze
CMD_REGEX = %r{\A/([a-z\d_]{,31})(@(\S+))?(\s|$)}i
CONFLICT_CMD_REGEX = Regexp.new("^(#{PAYLOAD_TYPES.join('|')}|\\d)")
abstract!
class << self
def dispatch(*args)