From 2d3e7bfdd6ced1e2acb3af24c6a32c465cd521e7 Mon Sep 17 00:00:00 2001 From: Vegard Berg Date: Mon, 30 Sep 2024 21:04:16 +0200 Subject: [PATCH] feat: sanity check - log if guild ID is nil. --- commands/gatekeep.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/commands/gatekeep.go b/commands/gatekeep.go index 193e2fb..877b2c7 100644 --- a/commands/gatekeep.go +++ b/commands/gatekeep.go @@ -45,7 +45,8 @@ func ApproveUserCommandHandler(e *handler.CommandEvent) error { guild, inGuild := e.Guild() if !inGuild { - slog.Warn("Approve command supplied in DMs or guild ID is otherwise nil") + slog.Warn("Approve command supplied in DMs or guild ID is otherwise nil", + "guild_id_is_nil", e.GuildID() == nil) return nil } member := e.UserCommandInteractionData().TargetMember() @@ -58,7 +59,8 @@ func ApproveSlashCommandHandler(e *handler.CommandEvent) error { guild, inGuild := e.Guild() if !inGuild { - slog.Warn("Approve command supplied in DMs or guild ID is otherwise nil") + slog.Warn("Approve command supplied in DMs or guild ID is otherwise nil", + "guild_id_is_nil", e.GuildID() == nil) return nil } member := e.SlashCommandInteractionData().Member("user")