-
Notifications
You must be signed in to change notification settings - Fork 42
feat(experimental): added a job/introduction bot detection #461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR Summary
|
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.
|
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. |
|
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. |
There was a problem hiding this 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",
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. |
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
description:
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.