diff options
author | Pratyush Desai | 2024-10-02 20:07:10 +0200 |
---|---|---|
committer | Pratyush Desai | 2024-10-02 20:07:10 +0200 |
commit | a5cc5e031754db83816e59849de6cb75ff92f9ae (patch) | |
tree | b04127246cf8950a881904771bb2249aebb385c4 /wat/bot.go | |
parent | a475bc2f428c6fb6905f3f2896b5477a6e361f32 (diff) | |
parent | 89ed59a9c71e4b21e462a5c7746a8decc41dc487 (diff) | |
download | watbot-a5cc5e031754db83816e59849de6cb75ff92f9ae.tar.gz watbot-a5cc5e031754db83816e59849de6cb75ff92f9ae.tar.bz2 watbot-a5cc5e031754db83816e59849de6cb75ff92f9ae.zip |
Merge pull request 'Implement Jeopardy cashout' (#18) from jeopardy into master
Reviewed-on: https://git.com.de/LibertaCasa/watbot/pulls/18
Diffstat (limited to 'wat/bot.go')
-rw-r--r-- | wat/bot.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -13,11 +13,14 @@ type WatBot struct { conn *tls.Conn c *WatConfig game *WatGame + integration *WatIntegration Db *WatDb Nick string } type WatConfig struct { + BotHosts []string + BotGames BotGameConfig AdminHosts []string IgnoredHosts []string AutoJoinChannels []string @@ -28,6 +31,7 @@ func NewWatBot(config *irc.ClientConfig, watConfig *WatConfig, serverConn *tls.C wat := WatBot{conn: serverConn, Nick: config.Nick, c: watConfig} wat.Db = NewWatDb() wat.game = NewWatGame(&wat, wat.Db) + wat.integration = NewWatIntegration(&wat, wat.Db, &WatIntegrationConfig{BotHosts: watConfig.BotHosts, BotGames: watConfig.BotGames}) config.Handler = irc.HandlerFunc(wat.HandleIrcMsg) wat.client = irc.NewClient(wat.conn, *config) return &wat @@ -123,6 +127,11 @@ func (w *WatBot) Msg(m *irc.Message) { args = args[1:] } + // integration with games in other bots + if w.integration.HandleIntegration(m, args) { + return + } + // check if command char (or something weird) is present if args[0] != "wat" && args[0][0] != '#' { return |