aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-07-05 20:56:31 -0700
committerFuwn <[email protected]>2021-07-05 20:56:31 -0700
commit182652e49d3a242a6b8146a1b5a3aca8876e3891 (patch)
tree78e67e8871f2f74c67701efc7510c7a439e2955e /pkg
parentfeat(discord): cleanup commands on ctrl+c (diff)
downloadmunch-182652e49d3a242a6b8146a1b5a3aca8876e3891.tar.xz
munch-182652e49d3a242a6b8146a1b5a3aca8876e3891.zip
feat(discord): cleanup more discord stuff on sigterm
Diffstat (limited to 'pkg')
-rw-r--r--pkg/discord/bot.go4
-rw-r--r--pkg/utilities/signal.go3
2 files changed, 6 insertions, 1 deletions
diff --git a/pkg/discord/bot.go b/pkg/discord/bot.go
index d6cd6ff..3864632 100644
--- a/pkg/discord/bot.go
+++ b/pkg/discord/bot.go
@@ -22,3 +22,7 @@ func SetupBot() {
}
defer s.Close()
}
+
+func CleanupBot() {
+ s.Close()
+}
diff --git a/pkg/utilities/signal.go b/pkg/utilities/signal.go
index f739811..cd5fba3 100644
--- a/pkg/utilities/signal.go
+++ b/pkg/utilities/signal.go
@@ -23,8 +23,9 @@ func SetupSignalHandler() {
log.Println("SignalHandler: Killing Munch")
- log.Println("Cleaning up Discord bot application commands")
+ log.Println("Cleaning up Discord bot")
discord.CleanupCommands()
+ discord.CleanupBot()
os.Exit(1)
}()