Class: Nanobot::Config::TelegramConfig

Inherits:
Struct
  • Object
show all
Defined in:
lib/nanobot/config/schema.rb

Overview

Telegram channel configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enabled: false, token: nil, allow_from: [], proxy: nil) ⇒ TelegramConfig

Returns a new instance of TelegramConfig.

Parameters:

  • enabled (Boolean) (defaults to: false) —

    whether the Telegram channel is active

  • token (String, nil) (defaults to: nil) —

    Telegram Bot API token

  • allow_from (Array<String>) (defaults to: []) —

    allowed usernames or chat IDs

  • proxy (String, nil) (defaults to: nil) —

    HTTP proxy URL for Telegram API requests



128
129
130
# File 'lib/nanobot/config/schema.rb', line 128

def initialize(enabled: false, token: nil, allow_from: [], proxy: nil)
  super
end

Instance Attribute Details

#allow_from ⇒ Object

Returns the value of attribute allow_from

Returns:

  • (Object) —

    the current value of allow_from



123
124
125
# File 'lib/nanobot/config/schema.rb', line 123

def allow_from
  @allow_from
end

#enabled ⇒ Object

Returns the value of attribute enabled

Returns:

  • (Object) —

    the current value of enabled



123
124
125
# File 'lib/nanobot/config/schema.rb', line 123

def enabled
  @enabled
end

#proxy ⇒ Object

Returns the value of attribute proxy

Returns:

  • (Object) —

    the current value of proxy



123
124
125
# File 'lib/nanobot/config/schema.rb', line 123

def proxy
  @proxy
end

#token ⇒ Object

Returns the value of attribute token

Returns:

  • (Object) —

    the current value of token



123
124
125
# File 'lib/nanobot/config/schema.rb', line 123

def token
  @token
end