From 56d3c6b089a8aff760dcc5ce7646cf30e055b57d Mon Sep 17 00:00:00 2001 From: Toastie Date: Fri, 27 Dec 2024 17:30:05 +1300 Subject: [PATCH] Delete the notification when the bot pins a message --- EventHandler.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/EventHandler.cs b/EventHandler.cs index 5a0d6d8..fb8fde1 100644 --- a/EventHandler.cs +++ b/EventHandler.cs @@ -54,6 +54,11 @@ public static class EventHandler public static async Task OnMessageCreated(DiscordClient client, MessageCreatedEventArgs e) { + if (e.Author.IsCurrent && e.Message.MessageType == DiscordMessageType.ChannelPinnedMessage) + { + await e.Message.DeleteAsync(); + } + if (e.Author.IsBot) { return;