Module: TelegramOnSteroids

Defined in:
lib/telegram_on_steroids.rb,
lib/telegram_on_steroids/action.rb,
lib/telegram_on_steroids/version.rb,
lib/telegram_on_steroids/keyboard.rb,
lib/telegram_on_steroids/configurable.rb,
lib/telegram_on_steroids/configuration.rb

Defined Under Namespace

Modules: Configurable Classes: Action, Client, Configuration, InMemoryStore, Keyboard, Params, Process, RedisStore, Session, Updates

Constant Summary collapse

UPDATE_TYPES =
%w[message edited_message channel_post edited_channel_post message_reaction message_reaction_count inline_query chosen_inline_request callback_query shipping_query poll poll_answer my_chat_member chat_member chat_join_request chat_boost removed_chat_boost]
VERSION =
'0.1.2'

Class Method Summary collapse

Class Method Details

.__after_configuration(&block) ⇒ Object



18
19
20
# File 'lib/telegram_on_steroids/configuration.rb', line 18

def __after_configuration(&block)
  @__after_configuration = block
end

.configObject



7
8
9
# File 'lib/telegram_on_steroids/configuration.rb', line 7

def config
  @config ||= Configuration.new
end

.configure {|config| ... } ⇒ Object

Yields:



11
12
13
14
15
16
# File 'lib/telegram_on_steroids/configuration.rb', line 11

def configure
  yield(config)
  config.verify!

  @__after_configuration.call(config) if @__after_configuration
end

.process(params) ⇒ Object



21
22
23
# File 'lib/telegram_on_steroids.rb', line 21

def self.process(params)
  Process.new(params).process
end

.stop_updatesObject



35
36
37
# File 'lib/telegram_on_steroids.rb', line 35

def self.stop_updates
  @updates && @updates.stop = true
end

.updates(offset: nil, limit: nil, timeout: 60, allowed_updates: nil) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/telegram_on_steroids.rb', line 25

def self.updates(offset: nil, limit: nil, timeout: 60, allowed_updates: nil)
  params = {}
  params[:offset] = offset if offset
  params[:limit] = limit if limit
  params[:timeout] = timeout if timeout
  params[:allowed_updates] = allowed_updates if allowed_updates

  (@updates = Updates.new(params)).enum
end