Skip to content

feat: moderation tool migration into webdev-bot - #85

Open
michal-skraburski wants to merge 14 commits into
r-webdev:mainfrom
michal-skraburski:moderation-migrate
Open

feat: moderation tool migration into webdev-bot#85
michal-skraburski wants to merge 14 commits into
r-webdev:mainfrom
michal-skraburski:moderation-migrate

Conversation

@michal-skraburski

@michal-skraburski michal-skraburski commented Aug 16, 2026

Copy link
Copy Markdown

Moderation Tool Migration

Overview

This is a PR migrating the spam detection and moderation system for the webdev-bot from the moderation-tool bot, addressing the issue found here: #80

What I Did

  • Spam Detection Engine: Migrated a multi-rule spam detection system with three rule types.
  • Report Spam: Migrated the spam report message feature.
  • Refactors: Renamed both cache files to match their usage
  • Environment Configuration: Added SPAM_DETECTION_CHANNEL_ID to all environment files
  • Manually tested: Before committing to a finished PR, I manually tested the bot to ensure all moderation features crossed in working fashion.

Status:

DONE - Ready for review and feedback before finalization.

Made with ❤️, written by hand

This has several changes in one commit. Notably:
- The spam detection feature has been migrated, the spam detection
feature had several imports relinked to their respective webdev-bot/
counterparts
- Several tests have been syntactically modified to meet the
requirements of the new oxclint tool.
- The (now) two caches were migrated into util/cache and their names
were adapted to reflect of their exact usage.
- The MAX_RULE_TIMEFRAME constant was updated to refer to the correct
function instead of the placeholder. It may currently break convention
by importing from the features/.
- Currently 2 tests fail, one from the advent calendar and one from the
newly migrated spam-detection feature. Will follow up in next commit.
a stray console log led me to think the migration broke tests
@wiktoriavh

wiktoriavh commented Aug 16, 2026

Copy link
Copy Markdown
Member

Draft means it is not ready for review. Make it ready for review if you want a review.
correct the PR title to fit the schema of conventional commits.
connect it to the issue that it is solving.

Also, change the convention on this feature to match that of webdev-bot/
@michal-skraburski
michal-skraburski marked this pull request as ready for review August 16, 2026 21:02
@michal-skraburski

Copy link
Copy Markdown
Author

Draft means it is not ready for review. Make it ready for review if you want a review. correct the PR title to fit the schema of conventional commits. connect it to the issue that it is solving.

Sorry about that, I'm still learning the conventions of PR's so I will note this for the future. I've finished the implementation, and I hope I met your expectations. If not, I will happily take your critical assessment and revise the code.

Thanks for your help!

@michal-skraburski michal-skraburski changed the title Moderation migrate feat: moderation tool migration into webdev-bot Aug 16, 2026
Comment thread src/features/cache-messages/index.ts
Comment thread src/features/spam-detection/logs.test.ts Outdated
Comment thread src/util/channel-prefetch.ts
Comment thread src/util/cache/channel-prefetch.ts Outdated
Comment thread src/util/messages.ts
Comment thread .env.production Outdated
Comment thread .env.test Outdated

@hmd-ali hmd-ali left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@wiktoriavh wiktoriavh linked an issue Aug 17, 2026 that may be closed by this pull request
@wiktoriavh
wiktoriavh self-requested a review August 17, 2026 19:43
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.

Merge Moderation bot into the community bot

3 participants