1
This commit is contained in:
@@ -42,9 +42,19 @@ public class OpenPhoneForwardService {
|
||||
private static final int REPLY_TAKE_NTH_OPEN_BOT = 2;
|
||||
|
||||
/**
|
||||
* QingBao 机器人回复尾部的固定推广行(👉 与正文间可能含 ZWJ U+200D),整段替换为空格。
|
||||
* 情报局推广条:Telegram 常为 Markdown
|
||||
* {@code **👉**[**文案**](url)**👈**};另保留旧版纯文本。
|
||||
*/
|
||||
private static final String[] QINGBAO_REPLY_JUNK = {
|
||||
private static final Pattern[] QINGBAO_REPLY_JUNK_PATTERNS = {
|
||||
Pattern.compile(
|
||||
"\\*\\*👉\u200D?\\*\\*\\[\\*\\*公安路线查询价格表\\*\\*\\]"
|
||||
+ "\\(https?://t\\.me/\\+C20ADPmEKJU0ZGFl\\)\\*\\*👈\\*\\*"),
|
||||
Pattern.compile(
|
||||
"\\*\\*👉\u200D?\\*\\*\\[\\*\\*如机器人提示被注销点我防丢\\*\\*\\]"
|
||||
+ "\\(https?://telegra\\.ph/qingbaoju-10-01\\)\\*\\*👈\\*\\*"),
|
||||
};
|
||||
|
||||
private static final String[] QINGBAO_REPLY_JUNK_LITERAL = {
|
||||
"\uD83D\uDC49\u200D公安路线查询价格表 (https://t.me/+C20ADPmEKJU0ZGFl)\uD83D\uDC48",
|
||||
"\uD83D\uDC49\u200D如机器人提示被注销点我防丢 (https://telegra.ph/qingbaoju-10-01)\uD83D\uDC48",
|
||||
"\uD83D\uDC49公安路线查询价格表 (https://t.me/+C20ADPmEKJU0ZGFl)\uD83D\uDC48",
|
||||
@@ -171,10 +181,13 @@ public class OpenPhoneForwardService {
|
||||
}
|
||||
}
|
||||
|
||||
/** 将固定广告段替换为空格后 trim。 */
|
||||
/** 将固定广告段(Markdown 与纯文本)替换为空格后 trim。 */
|
||||
private static String filterQingBaoAdLines(String reply) {
|
||||
String s = reply;
|
||||
for (String junk : QINGBAO_REPLY_JUNK) {
|
||||
for (Pattern p : QINGBAO_REPLY_JUNK_PATTERNS) {
|
||||
s = p.matcher(s).replaceAll(" ");
|
||||
}
|
||||
for (String junk : QINGBAO_REPLY_JUNK_LITERAL) {
|
||||
s = s.replace(junk, " ");
|
||||
}
|
||||
return s.trim();
|
||||
|
||||
Reference in New Issue
Block a user