summaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorGeorg Pfuetzenreuter2024-09-21 18:40:29 +0200
committerGeorg Pfuetzenreuter2024-09-28 19:33:18 +0200
commit0a90b6e483bcf6d57030cc7f26f2a3b1a819b37e (patch)
tree3ba1171b3795f90ecabea7d217b56643dff2b3b9 /main.go
parentcc322e87e62fa19dabfbddd937da477feb9f2516 (diff)
downloadwatbot-0a90b6e483bcf6d57030cc7f26f2a3b1a819b37e.tar.gz
watbot-0a90b6e483bcf6d57030cc7f26f2a3b1a819b37e.tar.bz2
watbot-0a90b6e483bcf6d57030cc7f26f2a3b1a819b37e.zip
Implement automatic channel joining
Avoid the need for an administrator to join the bot to channels by implementing a configuration option allowing the passing of channels the bot should always join to by itself upon startup. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Diffstat (limited to 'main.go')
-rw-r--r--main.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/main.go b/main.go
index 2ae52d0..c242571 100644
--- a/main.go
+++ b/main.go
@@ -28,6 +28,7 @@ type watConfig struct {
Hosts []string `yaml:"hosts"`
} `yaml:"admins"`
Channels struct {
+ Join []string `yaml:"join"`
Permitted []string `yaml:"permitted"`
} `yaml:"channels"`
Ignores struct {
@@ -94,6 +95,7 @@ func main() {
Name: config.Name,
}
watConfig := wat.WatConfig{
+ AutoJoinChannels: config.Channels.Join,
PermittedChannels: config.Channels.Permitted,
IgnoredHosts: config.Ignores.Hosts,
AdminHosts: config.Admins.Hosts,