зеркало из
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
Этот коммит содержится в:
@@ -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)
|
||||
|
||||
Ссылка в новой задаче
Block a user