diff options
author | Georg Pfuetzenreuter | 2024-09-21 16:06:04 +0200 |
---|---|---|
committer | Georg Pfuetzenreuter | 2024-09-28 19:33:17 +0200 |
commit | bde9a8defb73399e5174794d7bb20907f8716832 (patch) | |
tree | 53bfb785c90168e4c82f5a3c1e26a9a7e9f042d3 /wat | |
parent | f4a9607770cc4f84431332ab4cdb7e292d037275 (diff) | |
download | watbot-bde9a8defb73399e5174794d7bb20907f8716832.tar.gz watbot-bde9a8defb73399e5174794d7bb20907f8716832.tar.bz2 watbot-bde9a8defb73399e5174794d7bb20907f8716832.zip |
Implement configuration file
Abstract settings which commonly differ between instances to a YAML
based configuration file to allow for easy administration without the
need for modifying the source code.
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Diffstat (limited to 'wat')
-rw-r--r-- | wat/bot.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -18,8 +18,9 @@ type WatBot struct { } type WatConfig struct { - PermittedChannels []string + AdminHosts []string IgnoredHosts []string + PermittedChannels []string } func NewWatBot(config *irc.ClientConfig, watConfig *WatConfig, serverConn *tls.Conn) *WatBot { @@ -45,7 +46,7 @@ func (w *WatBot) HandleIrcMsg(c *irc.Client, m *irc.Message) { } func (w *WatBot) Admin(m *irc.Message) bool { - admins := [2]string{"mph.monster", "cranberry.juice"} + admins := w.c.AdminHosts for _, admin := range admins { if m.Prefix.Host == admin { return true |