mirror of
https://github.com/chainstacklabs/pumpfun-bonkfun-bot.git
synced 2026-08-17 01:08:05 +00:00
Update scam patterns for tagging
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: Suspicious Comment Detection
|
kname: Suspicious Comment Detection
|
||||||
|
|
||||||
on:
|
on:
|
||||||
issue_comment:
|
issue_comment:
|
||||||
@@ -56,19 +56,42 @@ jobs:
|
|||||||
'reach out to',
|
'reach out to',
|
||||||
'through the chat',
|
'through the chat',
|
||||||
'portal',
|
'portal',
|
||||||
|
'help center',
|
||||||
|
'ticket',
|
||||||
|
'this will be review',
|
||||||
|
'bringing this to our notice',
|
||||||
|
'initiate a chat',
|
||||||
|
'regards',
|
||||||
|
'hello @',
|
||||||
|
'thanks for bringing',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Add pattern weight scoring
|
||||||
|
const patternWeights = {
|
||||||
|
'ticket id': 2,
|
||||||
|
'support team': 2,
|
||||||
|
'live support': 2,
|
||||||
|
'help center': 2,
|
||||||
|
// Regular patterns have weight of 1
|
||||||
|
};
|
||||||
|
|
||||||
|
// Calculate spam score
|
||||||
|
let spamScore = 0;
|
||||||
|
const foundPatterns = suspiciousPatterns.filter(pattern => {
|
||||||
|
if (body.includes(pattern)) {
|
||||||
|
spamScore += patternWeights[pattern] || 1;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
// Check for external links (excluding common legitimate domains)
|
// Check for external links (excluding common legitimate domains)
|
||||||
const hasExternalLinks = body.includes('http') || body.includes('www');
|
const hasExternalLinks = body.includes('http') || body.includes('www');
|
||||||
const hasGithubLinks = body.includes('github.com');
|
const hasGithubLinks = body.includes('github.com');
|
||||||
const suspiciousLinks = hasExternalLinks && !hasGithubLinks;
|
const suspiciousLinks = hasExternalLinks && !hasGithubLinks;
|
||||||
|
|
||||||
// Check for suspicious patterns
|
// Trigger on either multiple patterns or high spam score
|
||||||
const foundPatterns = suspiciousPatterns.filter(pattern =>
|
if (foundPatterns.length > 2 || spamScore >= 3) {
|
||||||
body.includes(pattern)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (foundPatterns.length > 0 || suspiciousLinks) {
|
|
||||||
try {
|
try {
|
||||||
// Create a warning comment
|
// Create a warning comment
|
||||||
await github.rest.issues.createComment({
|
await github.rest.issues.createComment({
|
||||||
@@ -97,4 +120,5 @@ jobs:
|
|||||||
console.log('Workflow error:', e);
|
console.log('Workflow error:', e);
|
||||||
// Still mark as failure but with more context
|
// Still mark as failure but with more context
|
||||||
core.setFailed(`Workflow failed: ${e.message}`);
|
core.setFailed(`Workflow failed: ${e.message}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user