Skip to content

Commit

Permalink
feature: Log if approve command is used in a DM context. (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
myrkvi authored Sep 30, 2024
2 parents 7570f44 + bdc79ec commit 2d20229
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions commands/gatekeep.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ 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")
return nil
}
member := e.UserCommandInteractionData().TargetMember()
Expand All @@ -53,6 +54,7 @@ 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")
return nil
}
member := e.SlashCommandInteractionData().Member("user")
Expand Down

0 comments on commit 2d20229

Please sign in to comment.