From 8afd1d12eb414aad920ce40fc1f721cab74b71a7 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Fri, 10 Oct 2025 11:13:00 -0700 Subject: feat(gateway): Use new channel and embeds for occasional listener actions --- packages/gateway/src/commands/utilities.ts | 57 ++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'packages/gateway/src/commands/utilities.ts') diff --git a/packages/gateway/src/commands/utilities.ts b/packages/gateway/src/commands/utilities.ts index 19f9e90..b109bdb 100644 --- a/packages/gateway/src/commands/utilities.ts +++ b/packages/gateway/src/commands/utilities.ts @@ -475,6 +475,63 @@ export const getAllChannelsInCategory = async ( return { channels, channelNames }; }; +export const sendPersonaLog = async ( + client: Client, + type: "persona" | "conversation" | "reaction", + personaName: string, + messageLink?: string, + isPrimer: boolean = false, +): Promise => { + try { + const logChannelId = "1426269876569509968"; + const channel = client.channels.cache.get(logChannelId); + + if (!channel || !("send" in channel)) return; + + const { EmbedBuilder } = await import("discord.js"); + + const embed = new EmbedBuilder() + .setTitle( + type === "persona" + ? "🎭 Persona Message" + : type === "conversation" + ? "💬 Conversation Starter" + : "👀 Random Reaction" + ) + .setColor( + type === "persona" + ? "#ff6b6b" + : type === "conversation" + ? "#4ecdc4" + : "#ffd93d" + ) + .addFields( + { + name: "Persona", + value: personaName, + inline: true, + }, + { + name: "Type", + value: isPrimer ? "Primer Message" : "Regular Message", + inline: true, + } + ) + .setTimestamp(); + + if (messageLink && !isPrimer) + embed.addFields({ + name: "Trigger Message", + value: `[Click to view](${messageLink})`, + inline: false, + }); + + await (channel as any).send({ embeds: [embed] }); + } catch (error) { + console.error("Failed to send persona log:", error); + } +}; + export const executeBulkRoleAssignment = async ( client: Client, roleId: string, -- cgit v1.2.3