From bde9a8defb73399e5174794d7bb20907f8716832 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Sat, 21 Sep 2024 16:06:04 +0200 Subject: 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 --- wat/bot.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'wat') diff --git a/wat/bot.go b/wat/bot.go index 48559d4..dae4e89 100644 --- a/wat/bot.go +++ b/wat/bot.go @@ -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 -- cgit v1.2.3