From 47310876b8516a37ee4e4177fb1f9092d4e565c4 Mon Sep 17 00:00:00 2001 From: Sheby <83452219+Shebyyy@users.noreply.github.com> Date: Mon, 16 Feb 2026 11:22:56 +0530 Subject: [PATCH 1/2] fix: issue again --- .../functions/shared/discordNotifications.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/supabase/functions/shared/discordNotifications.ts b/supabase/functions/shared/discordNotifications.ts index 552ec99..87d78f2 100644 --- a/supabase/functions/shared/discordNotifications.ts +++ b/supabase/functions/shared/discordNotifications.ts @@ -452,7 +452,7 @@ async function sendDiscordNotificationInternal(supabase: any, data: DiscordNotif if (data.comment?.id) { notificationId = data.comment.id } else { - const { data: newNotification } = await supabase + const result = await supabase .from('discord_notifications') .insert({ notification_type: data.type, @@ -466,6 +466,7 @@ async function sendDiscordNotificationInternal(supabase: any, data: DiscordNotif .select('id') .single() + const newNotification = result.data if (newNotification) { notificationId = newNotification.id } @@ -957,19 +958,20 @@ ${muteCommentSection} break case 'user_banned': - accentColor = 0x8B0000 // Dark Red - const banHasCommentInfo = commentId && commentContent - const banCommentSection = banHasCommentInfo ? - `💬 **Related Comment ID:** ${commentId} + accentColor = 0x8B0000 // Dark Red + const banHasCommentInfo = commentId && commentContent + const banCommentSection = banHasCommentInfo ? + `💬 **Related Comment ID:** ${commentId} 📺 **Media:** ${mediaTitle} (${mediaType}) 📝 **Comment:** › ${commentContent} ` : `👤 **Target User:** ${authorName} (ID: ${authorId})` - content = `⛔ **User Banned** + content = `⛔ **User Banned** 👮 **Actor:** ${moderatorName} (ID: ${moderatorId}) +👤 **Target User:** ${authorName} (ID: ${authorId}) ${banCommentSection} @@ -977,7 +979,7 @@ ${banCommentSection} 📄 **Reason:** › ${reason}` - break + break case 'user_unbanned': accentColor = 0x32CD32 // Lime Green From 04e6aeef68b046e9fea59fa412e7bda322c52911 Mon Sep 17 00:00:00 2001 From: Sheby <83452219+Shebyyy@users.noreply.github.com> Date: Mon, 16 Feb 2026 11:27:33 +0530 Subject: [PATCH 2/2] Again --- supabase/functions/shared/discordNotifications.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supabase/functions/shared/discordNotifications.ts b/supabase/functions/shared/discordNotifications.ts index 87d78f2..902eb1b 100644 --- a/supabase/functions/shared/discordNotifications.ts +++ b/supabase/functions/shared/discordNotifications.ts @@ -659,13 +659,13 @@ function createComponentsV2Message(data: DiscordNotificationData): any[] { 'SYSTEM': 0x808080 // Gray } - const categoryEmojis: { + const categoryEmojis = { 'COMMENT': '🟢 COMMENT EVENTS', 'REPORT': '🚨 REPORT EVENTS', 'USER MODERATION': '🔨 USER MODERATION EVENTS', 'VOTE': '👍 VOTE EVENTS', 'ANNOUNCEMENT': '📢 ANNOUNCEMENT', - 'SYSTEM': '📢 SYSTEM', + 'SYSTEM': '📢 SYSTEM' } components.push(buildSeparator(true, 2))