Skip to content

Commit

Permalink
Properly get the linked channel on react
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaUrsa committed Feb 19, 2024
1 parent 169b98a commit 85e2152
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/discord/commands/global/d.ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2269,17 +2269,13 @@ export async function aiReaction(
const thumbsDownEmojis = ['πŸ‘Ž', 'πŸ‘ŽπŸ»', 'πŸ‘ŽπŸΌ', 'πŸ‘ŽπŸ½', 'πŸ‘ŽπŸΎ', 'πŸ‘ŽπŸΏ', 'ts_thumbdown'];
if (messageReaction.message.reference === null) return;
const originalMessage = await messageReaction.message.fetchReference();
const aiLinkData = await db.ai_channels.findFirst({
where: {
channel_id: originalMessage.channel.id,
},
});
const aiLinkData = await getLinkedChannel(originalMessage.channel);

log.debug(F, `aiLinkData: ${JSON.stringify(aiLinkData, null, 2)}`);
log.debug(F, `messageReaction: ${JSON.stringify(messageReaction, null, 2)}`);
log.debug(F, `messageReaction.message.author: ${JSON.stringify(messageReaction.message.author, null, 2)}`);
log.debug(F, `user: ${JSON.stringify(user, null, 2)}`);
log.debug(F, `Emoji name: ${messageReaction.emoji.name}`);
// log.debug(F, `aiLinkData: ${JSON.stringify(aiLinkData, null, 2)}`);
// log.debug(F, `messageReaction: ${JSON.stringify(messageReaction, null, 2)}`);
// log.debug(F, `messageReaction.message.author: ${JSON.stringify(messageReaction.message.author, null, 2)}`);
// log.debug(F, `user: ${JSON.stringify(user, null, 2)}`);
// log.debug(F, `Emoji name: ${messageReaction.emoji.name}`);

if (aiLinkData
&& messageReaction.message.author?.bot
Expand Down

0 comments on commit 85e2152

Please sign in to comment.