Skip to content

feat: add spam detection event and cache handling command - #3

Merged
hmd-ali merged 31 commits into
mainfrom
feat/spam-detection
Nov 2, 2025
Merged

hmd-ali merged 31 commits into
mainfrom
feat/spam-detection

Conversation

@hmd-ali

@hmd-ali hmd-ali commented Oct 31, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@hmd-ali
hmd-ali requested a review from wiktoriavh October 31, 2025 21:29

@wiktoriavh wiktoriavh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add unit tests to the functions that don't need discord features to run? like the strip function i commented on.

Comment thread src/cache/message-cache.ts Outdated
Comment thread src/cache/message-cache.ts Outdated
Comment thread src/cache/message-cache.ts
Comment thread src/cache/message-cache.ts Outdated
Comment thread src/commands/messages-cache/index.ts Outdated
${messagesMd.channelsInvolved(new Set(options.messages.map((msg) => msg.channelId)))}
${messagesMd.deletedAndMuted(options.deletedMessagesCount, options.muteDuration)}`;

const textTextDisplayComponent = new TextDisplayBuilder().setContent(content);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text Text in the variable name

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it's a TextDisplayComponent called text 😅hence textTextDisplayComponent, if it's a title, it would be titleTextDisplayComponent

Comment thread src/events/spam-detection/logs.ts Outdated
Comment thread src/events/spam-detection/logs.ts
Comment on lines +81 to +94
{
type: "frequencyBased",
isBrokenBy: anyMessage,
timeframe: 3 * SECOND,
frequency: 15,
action: handleHighFrequencyAction,
},
{
type: "frequencyBased",
isBrokenBy: anyMessage,
timeframe: 6 * SECOND,
frequency: 20,
action: handleHighFrequencyAction,
},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this just means if a user writes whatever in any channel, not cross posting the same thing, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

Comment thread src/utils/messages.ts
@hmd-ali
hmd-ali merged commit d687402 into main Nov 2, 2025
1 check passed
@hmd-ali
hmd-ali deleted the feat/spam-detection branch November 2, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants