diff --git a/EventHandler.cs b/EventHandler.cs index 583787f..f908aae 100644 --- a/EventHandler.cs +++ b/EventHandler.cs @@ -76,9 +76,15 @@ internal static class EventHandler return; } - // Sends a DM to the assigned staff member if at least a day has gone by since the last message and the user sending the message isn't staff + // Ignore staff messages + if (Database.IsStaff(e.Author.Id)) + { + return; + } + + // Sends a DM to the assigned staff member if at least a day has gone by since the last message IReadOnlyList messages = await e.Channel.GetMessagesAsync(2); - if (messages.Count > 1 && messages[1].Timestamp < DateTimeOffset.UtcNow.AddDays(Config.ticketUpdatedNotificationDelay * -1) && !Database.IsStaff(e.Author.Id)) + if (messages.Count > 1 && messages[1].Timestamp < DateTimeOffset.UtcNow.AddDays(Config.ticketUpdatedNotificationDelay * -1)) { try { @@ -99,17 +105,17 @@ internal static class EventHandler switch (e.Exception) { case SlashExecutionChecksFailedException checksFailedException: - { - foreach (SlashCheckBaseAttribute attr in checksFailedException.FailedChecks) { - await e.Context.Channel.SendMessageAsync(new DiscordEmbedBuilder + foreach (SlashCheckBaseAttribute attr in checksFailedException.FailedChecks) { - Color = DiscordColor.Red, - Description = ParseFailedCheck(attr) - }); + await e.Context.Channel.SendMessageAsync(new DiscordEmbedBuilder + { + Color = DiscordColor.Red, + Description = ParseFailedCheck(attr) + }); + } + return; } - return; - } case BadRequestException ex: Logger.Error("Command exception occured:\n" + e.Exception); @@ -117,15 +123,15 @@ internal static class EventHandler return; default: - { - Logger.Error("Exception occured: " + e.Exception.GetType() + ": " + e.Exception); - await e.Context.Channel.SendMessageAsync(new DiscordEmbedBuilder { - Color = DiscordColor.Red, - Description = "Internal error occured, please report this to the developer." - }); - return; - } + Logger.Error("Exception occured: " + e.Exception.GetType() + ": " + e.Exception); + await e.Context.Channel.SendMessageAsync(new DiscordEmbedBuilder + { + Color = DiscordColor.Red, + Description = "Internal error occured, please report this to the developer." + }); + return; + } } }