Fix incorrect user check on set-for

This commit is contained in:
Noi 2022-06-20 17:16:02 -07:00
parent 6da3933eb8
commit 3d0f11a2cf

View file

@ -167,7 +167,7 @@ public class ApplicationCommands : InteractionModuleBase<ShardedInteractionConte
[SlashCommand("set-for", HelpSetFor)] [SlashCommand("set-for", HelpSetFor)]
public async Task CmdSetFor([Summary(description: "The user whose time zone to modify.")] SocketGuildUser user, public async Task CmdSetFor([Summary(description: "The user whose time zone to modify.")] SocketGuildUser user,
[Summary(description: "The new time zone to set.")] string zone) { [Summary(description: "The new time zone to set.")] string zone) {
if (!IsUserAdmin(user)) { if (!IsUserAdmin((SocketGuildUser)Context.User)) {
await RespondAsync(ErrNotAllowed, ephemeral: true).ConfigureAwait(false); await RespondAsync(ErrNotAllowed, ephemeral: true).ConfigureAwait(false);
return; return;
} }
@ -194,7 +194,7 @@ public class ApplicationCommands : InteractionModuleBase<ShardedInteractionConte
[RequireGuildContext] [RequireGuildContext]
[SlashCommand("remove-for", HelpRemoveFor)] [SlashCommand("remove-for", HelpRemoveFor)]
public async Task CmdRemoveFor([Summary(description: "The user whose time zone to remove.")] SocketGuildUser user) { public async Task CmdRemoveFor([Summary(description: "The user whose time zone to remove.")] SocketGuildUser user) {
if (!IsUserAdmin(user)) { if (!IsUserAdmin((SocketGuildUser)Context.User)) {
await RespondAsync(ErrNotAllowed, ephemeral: true).ConfigureAwait(false); await RespondAsync(ErrNotAllowed, ephemeral: true).ConfigureAwait(false);
return; return;
} }