From 97e9d7d0c2312385bfd8dcbb85a1bc4bd7d263cc Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Sun, 22 Sep 2024 17:42:49 +0200 Subject: Implement Jeopardy cashout This adds integration between Watbot and the Limnoria Jeopardy plugin. If a game of Jeopardy ends, Watbot will parse the finishers message and pay a small share of the Jeopardy price money in the form of Watcoins. To avoid abuse, only Jeopardy finishing messages from authorized bots are considered. An IRC user is considered an authorized bot if the hostmask matches one of the configured bot hostmasks, and if the nickname is configured for "jeopardy" in the newly introduced bot games configuration. Signed-off-by: Georg Pfuetzenreuter Add sample message to Jeopardy logic Signed-off-by: Georg Pfuetzenreuter --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index c242571..fb71444 100644 --- a/main.go +++ b/main.go @@ -24,6 +24,10 @@ type watConfig struct { Pass string `yaml:"pass"` User string `yaml:"user"` Name string `yaml:"name"` + Bots struct { + Hosts []string `yaml:"hosts"` + Games wat.BotGameConfig `yaml:"games"` + } `yaml:"bots"` Admins struct { Hosts []string `yaml:"hosts"` } `yaml:"admins"` @@ -99,6 +103,8 @@ func main() { PermittedChannels: config.Channels.Permitted, IgnoredHosts: config.Ignores.Hosts, AdminHosts: config.Admins.Hosts, + BotHosts: config.Bots.Hosts, + BotGames: config.Bots.Games, } tcpConf := &tls.Config{ InsecureSkipVerify: !config.Server.TlsVerify, -- cgit v1.2.3