Class: TelegramBotEngine::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/telegram_bot_engine/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/telegram_bot_engine/configuration.rb', line 10

def initialize
  @allowed_usernames = nil
  @admin_enabled = true
  @unauthorized_message = "Sorry, you're not authorized to use this bot."
  @welcome_message = "Welcome %{username}! Available commands:\n%{commands}"
  @event_logging = true
  @event_retention_days = 30

  @webhook_base_url = nil               # host public https base, e.g. "https://app.example.com"
  @webhook_mount_path = "/telegram/bot" # MUST match `mount TelegramBotEngine::Dispatch, at:`
  @dispatch_controller = nil            # host UpdatesController (String/class) incl. SubscriberCommands
  @auto_register_webhooks = true        # (un)register webhooks on Bot save/destroy when base_url present
end

Instance Attribute Details

#admin_enabledObject

Returns the value of attribute admin_enabled.



5
6
7
# File 'lib/telegram_bot_engine/configuration.rb', line 5

def admin_enabled
  @admin_enabled
end

#allowed_usernamesObject

Returns the value of attribute allowed_usernames.



5
6
7
# File 'lib/telegram_bot_engine/configuration.rb', line 5

def allowed_usernames
  @allowed_usernames
end

#auto_register_webhooksObject

Returns the value of attribute auto_register_webhooks.



5
6
7
# File 'lib/telegram_bot_engine/configuration.rb', line 5

def auto_register_webhooks
  @auto_register_webhooks
end

#dispatch_controllerObject

Returns the value of attribute dispatch_controller.



5
6
7
# File 'lib/telegram_bot_engine/configuration.rb', line 5

def dispatch_controller
  @dispatch_controller
end

#event_loggingObject

Returns the value of attribute event_logging.



5
6
7
# File 'lib/telegram_bot_engine/configuration.rb', line 5

def event_logging
  @event_logging
end

#event_retention_daysObject

Returns the value of attribute event_retention_days.



5
6
7
# File 'lib/telegram_bot_engine/configuration.rb', line 5

def event_retention_days
  @event_retention_days
end

#unauthorized_messageObject

Returns the value of attribute unauthorized_message.



5
6
7
# File 'lib/telegram_bot_engine/configuration.rb', line 5

def unauthorized_message
  @unauthorized_message
end

#webhook_base_urlObject

Returns the value of attribute webhook_base_url.



5
6
7
# File 'lib/telegram_bot_engine/configuration.rb', line 5

def webhook_base_url
  @webhook_base_url
end

#webhook_mount_pathObject

Returns the value of attribute webhook_mount_path.



5
6
7
# File 'lib/telegram_bot_engine/configuration.rb', line 5

def webhook_mount_path
  @webhook_mount_path
end

#welcome_messageObject

Returns the value of attribute welcome_message.



5
6
7
# File 'lib/telegram_bot_engine/configuration.rb', line 5

def welcome_message
  @welcome_message
end