Skip to content

Commit

Permalink
feat: sanity check - log if guild ID is nil.
Browse files Browse the repository at this point in the history
  • Loading branch information
myrkvi committed Sep 30, 2024
1 parent 662760b commit 2d3e7bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions commands/gatekeep.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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")
Expand Down

0 comments on commit 2d3e7bf

Please sign in to comment.