From 9b05da8e11ed012a9237c3228ccb5d43283a7e00 Mon Sep 17 00:00:00 2001 From: Thunder Date: Thu, 14 Sep 2023 16:27:04 -0400 Subject: [PATCH 1/2] Cannot deny yourself from your own VC --- BLART/Commands/ChannelRenting/DenyCommand.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/BLART/Commands/ChannelRenting/DenyCommand.cs b/BLART/Commands/ChannelRenting/DenyCommand.cs index 522eedd..1f42ac7 100755 --- a/BLART/Commands/ChannelRenting/DenyCommand.cs +++ b/BLART/Commands/ChannelRenting/DenyCommand.cs @@ -31,8 +31,15 @@ await RespondAsync(embed: await ErrorHandlingService.GetErrorEmbed(ErrorCodes.Pe if (ulong.TryParse(s.Replace("<", string.Empty).Replace("@", string.Empty).Replace(">", string.Empty), out ulong userId)) { IGuildUser user = Context.Guild.GetUser(userId); - if (user is not null) - guildUsers.Add(user); + if (user is not null) + { + if (user.Id == Context.User.Id) + { + await RespondAsync("You cannot deny yourself access to your own VC... is everything okay?", ephemeral: true); + return; + } + guildUsers.Add(user); + } } } From f87ffcc69f0ab7ccf31c2d7ea2bd701c92c418ef Mon Sep 17 00:00:00 2001 From: Thunder Date: Thu, 14 Sep 2023 16:27:32 -0400 Subject: [PATCH 2/2] clean code --- BLART/Commands/ChannelRenting/DenyCommand.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/BLART/Commands/ChannelRenting/DenyCommand.cs b/BLART/Commands/ChannelRenting/DenyCommand.cs index 1f42ac7..f4b0ee7 100755 --- a/BLART/Commands/ChannelRenting/DenyCommand.cs +++ b/BLART/Commands/ChannelRenting/DenyCommand.cs @@ -38,6 +38,7 @@ await RespondAsync(embed: await ErrorHandlingService.GetErrorEmbed(ErrorCodes.Pe await RespondAsync("You cannot deny yourself access to your own VC... is everything okay?", ephemeral: true); return; } + guildUsers.Add(user); } }