diff options
| author | Fuwn <[email protected]> | 2025-10-10 11:13:00 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-10-10 11:13:00 -0700 |
| commit | 8afd1d12eb414aad920ce40fc1f721cab74b71a7 (patch) | |
| tree | d164965d4b9e6f7e0a46b12f2ab3253937f9edf5 /packages/gateway/src/commands | |
| parent | feat(gateway:listeners): Add message logs to uma personas (diff) | |
| download | umabotdiscord-8afd1d12eb414aad920ce40fc1f721cab74b71a7.tar.xz umabotdiscord-8afd1d12eb414aad920ce40fc1f721cab74b71a7.zip | |
feat(gateway): Use new channel and embeds for occasional listener actions
Diffstat (limited to 'packages/gateway/src/commands')
| -rw-r--r-- | packages/gateway/src/commands/utilities.ts | 57 |
1 files changed, 57 insertions, 0 deletions
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<void> => { + 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, |