Skip to content

Conversation

@Simplyalex99
Copy link
Contributor

@Simplyalex99 Simplyalex99 commented Jun 11, 2025

description:

  • Added a bot scanner to remove messages of job postings in channels: help-react, help-js, help-react-native, help-styling, help-backend, general-react,general-tech. After 5 minutes, the reply message from the bot disappears.
  • Added missing channels help-react-native, help-styling, help-backend, general-react,general-tech to channels.ts.

I have attached a video as a preview of this new feature. For some context, the first two messages in the video are about a job posting, which gets removed by the bot, and the last message is legit and does not get removed.

demo_LndJtupw.mp4

update: The bot now solely removes posts related to job postings rather than both intro and job posts to simplify the process and prevent false positives/negatives. Added an edge case for code blocks with dollar signs inside for languages like jQuery and other libraries. Any attempt to bypass the bot by including code blocks with dollar a sign and other job keywords gets marked as a job posting ensuring consistency and accuracy.

@what-the-diff
Copy link

what-the-diff bot commented Jun 11, 2025

PR Summary

  • Enhanced Channel Information in channels.ts:
    The channel identifiers were expanded in our chat platform. Channels for introduction, generalTech, jobsAdvice, generalReact, helpReactNative, helpStyling, and helpBackend were added. This helps in categorizing topics and conversations better and assists in smooth communication transitions.

  • Creation of message-scanner.ts File:

    • A new feature called message-scanner has been introduced. This works akin to a watch guard to monitor messages related to job postings.
    • Whenever a job post is detected outside of the designated job channels, it warns the user to relocate the post to the relevant channels and then proceeds to automatically delete the original message after a given amount of time. This helps maintain the order and relevance of content across various channels.
  • Incorporation of messageScanner in index.ts:

    • The new messageScanner module has been integrated into the main functioning of the app. It is now set up to keep track of selected channels. This enhancement will help maintain the balance and integrity of content in various channels.

Removed job title keyword to prevent false positives, and to keep the bot solely for job posting related messages rather than intro and job postings. Removed unneeded edge case that could result in false negatives.
Added a more helpful feedback in case of job advice related posts using similar keywords such as full time or job opportunity.
Added an edge case for code blocks using dollar sign and refactored if statement.
@Simplyalex99 Simplyalex99 changed the title feat: added a job/introduction bot detection feat(experimental): added a job/introduction bot detection Jun 12, 2025
@Simplyalex99 Simplyalex99 marked this pull request as draft June 13, 2025 13:08
@Simplyalex99
Copy link
Contributor Author

update: After careful inspection, the .includes function is returning false positives for legitimate post like "help me". Currently working on using regex instead of .includes.

@Simplyalex99
Copy link
Contributor Author

update: Fixed incorrect messages being marked as a job posting with partial job keywords rather than the full job keywords by using regex to test for full keywords in job keywords. Removed currencies from job keywords into a separate array to test if a message contains any substring of currencies.

Also added two more keywords that 100% should be marked as a job posting such as "we are hiring". The code is ready to be merged.

@Simplyalex99 Simplyalex99 marked this pull request as ready for review June 13, 2025 16:20
@vcarl vcarl requested a review from Copilot June 14, 2025 16:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces an experimental bot detection feature to remove job posting messages in specific channels and updates the channels configuration accordingly.

  • Implements a new message scanner that detects job postings via keyword matching and bypasses messages containing code blocks with dollar signs.
  • Updates the handler registration in index.ts to include the new scanner on additional channels.
  • Adds missing channel entries in channels.ts for the new feature.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/index.ts Registers the message scanner for job posting detection on added channels.
src/features/message-scanner.ts Implements bot detection logic using regex and keyword matching.
src/constants/channels.ts Extends the channel constants with new channel mappings.
Comments suppressed due to low confidence (2)

src/features/message-scanner.ts:62

  • CHANNELS.jobsLog and CHANNELS.lookingForGroup are referenced in the warning message but are not defined in the channels constants. Please update the message to reference only the valid, defined channels.
const warningMsg = `Oops <@${msg.author.id}>! This message looks more like a job/collaboration/advice post. Mind sharing that in <#${CHANNELS.jobsLog}> or <#${CHANNELS.lookingForGroup}> or <#${CHANNELS.jobsAdvice}> instead? If this was a mistake, please try again and ask your question. Appreciate you helping us keep channels on-topic 🙌`;

src/constants/channels.ts:24

  • Local channel IDs for generalTech, jobsAdvice, generalReact, helpReactNative, helpStyling, and helpBackend share the same value. Please verify if each channel should have a unique identifier.
  generalTech: "1166062952084942940",

@Simplyalex99
Copy link
Contributor Author

Pull Request Overview

This PR introduces an experimental bot detection feature to remove job posting messages in specific channels and updates the channels configuration accordingly.

  • Implements a new message scanner that detects job postings via keyword matching and bypasses messages containing code blocks with dollar signs.
  • Updates the handler registration in index.ts to include the new scanner on additional channels.
  • Adds missing channel entries in channels.ts for the new feature.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/index.ts Registers the message scanner for job posting detection on added channels.
src/features/message-scanner.ts Implements bot detection logic using regex and keyword matching.
src/constants/channels.ts Extends the channel constants with new channel mappings.
Comments suppressed due to low confidence (2)
src/features/message-scanner.ts:62

  • CHANNELS.jobsLog and CHANNELS.lookingForGroup are referenced in the warning message but are not defined in the channels constants. Please update the message to reference only the valid, defined channels.
const warningMsg = `Oops <@${msg.author.id}>! This message looks more like a job/collaboration/advice post. Mind sharing that in <#${CHANNELS.jobsLog}> or <#${CHANNELS.lookingForGroup}> or <#${CHANNELS.jobsAdvice}> instead? If this was a mistake, please try again and ask your question. Appreciate you helping us keep channels on-topic 🙌`;

src/constants/channels.ts:24

  • Local channel IDs for generalTech, jobsAdvice, generalReact, helpReactNative, helpStyling, and helpBackend share the same value. Please verify if each channel should have a unique identifier.
  generalTech: "1166062952084942940",

Yes, the channels have already been added and are all valid. In addition, there are duplicate channel IDS but only in the local channels constant. This is intentional as it is just for development testing purposes, and the duplicate IDS are copied from existing duplicate IDS in the local channel constants such as resumeReview.

@vcarl vcarl merged commit f946770 into reactiflux:main Jun 14, 2025
2 checks passed
vcarl added a commit that referenced this pull request Jun 14, 2025
Simplyalex99 added a commit to Simplyalex99/reactibot that referenced this pull request Jun 19, 2025
feat: added a job/introduction bot scanner

update: added more job keywords

update: removed job titles keywords and edge case

Removed job title keyword to prevent false positives, and to keep the bot solely for job posting related messages rather than intro and job postings. Removed unneeded edge case that could result in false negatives.

update: removed unneeded edge case

update: warning message

Added a more helpful feedback in case of job advice related posts using similar keywords such as full time or job opportunity.

update: added edge case for langs with dollar sign

Added an edge case for code blocks using dollar sign and refactored if statement.

fix: messages being deleted with partial job keywords rather than full.

fix: removed duplicate job keyword

feat(experimental): added a job/introduction bot detection (reactiflux#461)

* update: added more channels

* feat: added a job/introduction bot scanner

* update: added more job keywords

* update: removed job titles keywords and edge case

Removed job title keyword to prevent false positives, and to keep the bot solely for job posting related messages rather than intro and job postings. Removed unneeded edge case that could result in false negatives.

* update: removed unneeded edge case

* update: warning message

Added a more helpful feedback in case of job advice related posts using similar keywords such as full time or job opportunity.

* update: added edge case for langs with dollar sign

Added an edge case for code blocks using dollar sign and refactored if statement.

* fix: messages being deleted with partial job keywords rather than full.

* fix: removed duplicate job keyword

Revert "feat(experimental): added a job/introduction bot detection (reactiflux#461)"

This reverts commit f946770.

fix: Shared references causing auto thread to be added to new channels (reactiflux#464)

* fix: Shared references causing auto thread to be added to new channels

* fix: removed print statement

add: cross post command (reactiflux#465)

* add: cross post command

* update: description text

IS:00 fix: prettier lint issues (reactiflux#470)

update: organized channels , and removed introduction

refactor: renamed feature to job scanner
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