all repos — stealth-developers @ 1dcd59c5bf321ecbb5570d25808717d179b5fbdc

feat: show found words in embed
willow hai@wlo.moe
Tue, 22 Jul 2025 12:46:11 +0100
commit

1dcd59c5bf321ecbb5570d25808717d179b5fbdc

parent

2a451ccea8ab4d5e21eb8469ce571d46920ad06f

1 files changed, 5 insertions(+), 2 deletions(-)

jump to
M src/utils/forumWatcher.tssrc/utils/forumWatcher.ts

@@ -141,12 +141,14 @@ "exploits",

]; for (const post of newPosts) { - const includesWord = flaggedWords.some( + if (!post.firstComment || !post.firstComment.content) continue; + const foundWords = flaggedWords.filter( (word) => post.name.toLowerCase().includes(word) || post.firstComment.content.plainText.toLowerCase().includes(word), ); - if (!includesWord) continue; + if (foundWords.length === 0) continue; + const postLink = `https://roblox.com/communities/${forumConfig.groupId}/${forumConfig.groupName}#!/forums/${forumConfig.channelId}/post/${post.id}`; const postContainer = new ContainerBuilder();

@@ -182,6 +184,7 @@

const footerParts = [ `user id: ${inlineCode(String(post.createdBy))}`, `posted <t:${Math.round(new Date(post.createdAt).getTime() / 1000)}:R>`, + `matched words: ${foundWords.map((word) => inlineCode(word)).join(", ")}`, ]; const postFooter = new TextDisplayBuilder().setContent( `-# ${footerParts.join(" • ")}`,