summaryrefslogtreecommitdiffstats
path: root/wat
diff options
context:
space:
mode:
authorGeorg Pfuetzenreuter2024-09-21 16:06:04 +0200
committerGeorg Pfuetzenreuter2024-09-28 19:33:17 +0200
commitbde9a8defb73399e5174794d7bb20907f8716832 (patch)
tree53bfb785c90168e4c82f5a3c1e26a9a7e9f042d3 /wat
parentf4a9607770cc4f84431332ab4cdb7e292d037275 (diff)
downloadwatbot-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.go5
1 files changed, 3 insertions, 2 deletions
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