From dfe7deff72ec77f798efe243c1c22bb63c523040 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Thu, 10 Oct 2024 00:04:16 +0200 Subject: Configurable database path Allow the database file to reside in a user defined location instead of requiring it to be in the working directory. Signed-off-by: Georg Pfuetzenreuter --- wat/bot.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'wat/bot.go') diff --git a/wat/bot.go b/wat/bot.go index ffa6d8b..806906c 100644 --- a/wat/bot.go +++ b/wat/bot.go @@ -20,6 +20,7 @@ type WatBot struct { } type WatConfig struct { + DatabasePath string BotHosts []string BotGames BotGameConfig AdminHosts []string @@ -30,7 +31,7 @@ type WatConfig struct { func NewWatBot(config *irc.ClientConfig, watConfig *WatConfig, serverConn *tls.Conn) *WatBot { wat := WatBot{conn: serverConn, Nick: config.Nick, c: watConfig} - wat.Db = NewWatDb() + wat.Db = NewWatDb(watConfig.DatabasePath) 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) -- cgit v1.2.3