MCPcopy Index your code
hub / github.com/AnswerOverflow/AnswerOverflow / updateReactions

Function updateReactions

packages/core/src/message-node.ts:99–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

97 }
98 };
99 const updateReactions = async () => {
100 await db.delete(dbReactions).where(eq(dbReactions.messageId, msg.id));
101 if (!reactions) return;
102 const emojis = new Set(reactions.map((r) => r.emoji));
103 for await (const emoji of emojis) {
104 const p = emojiSchema.parse(emoji);
105 await db.insert(dbEmojis).values(p).onDuplicateKeyUpdate({
106 set: p,
107 });
108 }
109 for await (const reaction of reactions) {
110 const p = reactionSchema.parse(reaction);
111 await db.insert(dbReactions).values(p).onDuplicateKeyUpdate({
112 set: p,
113 });
114 }
115 };
116 await updateReactions();
117 void updateAttachments();
118}

Callers 1

upsertMessageFunction · 0.85

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected