config

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BotVerified   bool            `json:"botVerified"`
	LogsDirectory string          `json:"logsDirectory"`
	Archive       bool            `json:"archive"`
	AdminAPIKey   string          `json:"adminAPIKey"`
	Username      string          `json:"username"`
	OAuth         string          `json:"oauth"`
	ListenAddress string          `json:"listenAddress"`
	Admins        []string        `json:"admins"`
	Channels      []string        `json:"channels"`
	ClientID      string          `json:"clientID"`
	ClientSecret  string          `json:"clientSecret"`
	LogLevel      string          `json:"logLevel"`
	OptOut        map[string]bool `json:"optOut"`
	// contains filtered or unexported fields
}

Config application configuration

func NewConfig

func NewConfig(filePath string) *Config

NewConfig create configuration from file

func (*Config) AddChannels

func (cfg *Config) AddChannels(channelIDs ...string)

AddChannels adds channels to the config

func (*Config) IsOptedOut

func (cfg *Config) IsOptedOut(userID string) bool

IsOptedOut check if a user is opted out

func (*Config) OptOutUsers

func (cfg *Config) OptOutUsers(userIDs ...string)

OptOutUsers will opt out a user

func (*Config) RemoveChannels

func (cfg *Config) RemoveChannels(channelIDs ...string)

RemoveChannels removes channels from the config

func (*Config) RemoveOptOut

func (cfg *Config) RemoveOptOut(userIDs ...string)

AddChannels remove user from opt out

func (*Config) SetupLogger added in v1.0.3

func (cfg *Config) SetupLogger()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL