Skip to content

Commit

Permalink
/transfer_warnings: Fail if source & target users are the same
Browse files Browse the repository at this point in the history
  • Loading branch information
FloatingMilkshake committed Jul 20, 2024
1 parent 2ba7036 commit 4366efb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Commands/InteractionCommands/WarningInteractions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ public async Task TransferWarningsSlashCommand(InteractionContext ctx,
[Option("force_override", "DESTRUCTIVE OPERATION: Whether to OVERRIDE and DELETE the target users existing warnings.")] bool forceOverride = false
)
{
if (sourceUser == targetUser)
{
await ctx.RespondAsync($"{Program.cfgjson.Emoji.Error} The source and target users cannot be the same!");
return;
}

var sourceWarnings = await Program.db.HashGetAllAsync(sourceUser.Id.ToString());
var targetWarnings = await Program.db.HashGetAllAsync(targetUser.Id.ToString());

Expand Down

0 comments on commit 4366efb

Please sign in to comment.