MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / executeBlockActions

Function executeBlockActions

pmcaptcha/pmcaptcha.ts:1313–1337  ·  view source on GitHub ↗

* 执行自动拦截操作(黑名单/Premium ban 等触发时) * 复用 captcha 失败的操作逻辑

(client: TelegramClient, userId: number)

Source from the content-addressed store, hash-verified

1311 }
1312
1313 // 规则 3: 共同群过白
1314 const groupsResult = await checkGroupsInCommon(client, userId);
1315 if (groupsResult === "pass") return true;
1316 if (groupsResult === "block") {
1317 await executeBlockActions(client, userId);
1318 return true;
1319 }
1320
1321 // 规则 4: 关键词过白 / 黑名单拦截
1322 const wordResult = await checkWordFilter(client, userId, message);
1323 if (wordResult === "pass") return true;
1324 if (wordResult === "block") {
1325 await executeBlockActions(client, userId);
1326 return true;
1327 }
1328
1329 // 规则 5: Premium 用户策略
1330 const premiumResult = await checkPremium(client, userId, message);
1331 if (premiumResult === "pass") return true;
1332 if (premiumResult === "block") {
1333 await executeBlockActions(client, userId);
1334 return true;
1335 }
1336
1337 return false; // 所有规则都未触发,继续正常验证流程
1338}
1339
1340/**

Callers 1

runAutoRulesFunction · 0.85

Calls 5

archiveChatFunction · 0.85
muteChatFunction · 0.85
logFunction · 0.85
getDisplayNameFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected