Class: Telegram::BotManager::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/telegram/bot_manager/application.rb

Instance Method Summary collapse

Constructor Details

#initialize(configuration) ⇒ Application

Returns a new instance of Application.



7
8
9
10
11
12
13
# File 'lib/telegram/bot_manager/application.rb', line 7

def initialize(configuration)
  @configuration = configuration
  @bot = @configuration.bot

  configure
  configuration_message if BotManager.configuration.show_config_message
end

Instance Method Details

#configureObject



15
16
17
18
# File 'lib/telegram/bot_manager/application.rb', line 15

def configure
rescue => exception
  handle_exception(exception)
end

#runObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/telegram/bot_manager/application.rb', line 20

def run
  startup_message

  Telegram::Bot::UpdatesPoller.start(
    @bot,
    controller
  )
rescue => exception
  handle_exception(exception)
end