Skip to content

Commit

Permalink
Defer if bot channel
Browse files Browse the repository at this point in the history
  • Loading branch information
FeroxFoxxo committed Nov 9, 2023
1 parent dc3731d commit 8b11ac6
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions backend/Greeting/Commands/GreeterMute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ namespace Greeting.Commands;
public class GreeterMute : PunishmentCommand<GreeterMute>
{
public GreeterDatabase GreeterDatabase { get; set; }
private GreetGateModel greetGate;

public override async Task BeforeCommandExecute()
{
greetGate = await GreeterDatabase.GreeterConfigs.FindAsync(Context.Guild.Id);

await Context.Interaction.DeferAsync(greetGate == null);
ModCaseRepository.AsUser(Identity);
}

[RequireGreeter]
[SlashCommand("gmute", "Greeter mute command, executes on valid critera")]
Expand All @@ -35,6 +26,7 @@ public async Task MuteCommand(
[Summary("description", "The description of the mod case")]
string description = "")
{
var greetGate = await GreeterDatabase.GreeterConfigs.FindAsync(Context.Guild.Id);
var disallowedRole = user.RoleIds.FirstOrDefault(r => greetGate.DisallowedMuteRoles.Contains(r));

if (disallowedRole != default)
Expand Down

0 comments on commit 8b11ac6

Please sign in to comment.