Class: Nanobot::Config::DiscordConfig

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

Overview

Discord channel configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of DiscordConfig.

Parameters:

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

    whether the Discord channel is active

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

    Discord bot token

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

    allowed user IDs or usernames



138
139
140
# File 'lib/nanobot/config/schema.rb', line 138

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

Instance Attribute Details

#allow_from ⇒ Object

Returns the value of attribute allow_from

Returns:

  • (Object) —

    the current value of allow_from



134
135
136
# File 'lib/nanobot/config/schema.rb', line 134

def allow_from
  @allow_from
end

#enabled ⇒ Object

Returns the value of attribute enabled

Returns:

  • (Object) —

    the current value of enabled



134
135
136
# File 'lib/nanobot/config/schema.rb', line 134

def enabled
  @enabled
end

#token ⇒ Object

Returns the value of attribute token

Returns:

  • (Object) —

    the current value of token



134
135
136
# File 'lib/nanobot/config/schema.rb', line 134

def token
  @token
end