koishi-plugin-ets2-tools-tmp 3.3.64 → 3.3.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -669,16 +669,24 @@ class ActivityService {
|
|
|
669
669
|
continue;
|
|
670
670
|
}
|
|
671
671
|
|
|
672
|
-
const
|
|
672
|
+
const text = template
|
|
673
673
|
.replace(/\{date\}/g, dateText)
|
|
674
674
|
.replace(/\{name\}/g, name)
|
|
675
675
|
.replace(/\\n/g, "\n")
|
|
676
676
|
.trim();
|
|
677
677
|
|
|
678
|
+
// 模板以「@全体成员」开头时替换成真实的全体 @(onebot 适配器会转成 [CQ:at,qq=all]);
|
|
679
|
+
// 纯文本的 "@全体成员" 在 QQ 里只是一串字,不会触发全员提醒。
|
|
680
|
+
// 想退回纯文本:把模板开头的「@全体成员」删掉即可。
|
|
681
|
+
const AT_ALL_PREFIX = '@全体成员';
|
|
682
|
+
const payload = text.startsWith(AT_ALL_PREFIX)
|
|
683
|
+
? [koishi_1.h('at', { type: 'all' }), text.slice(AT_ALL_PREFIX.length)]
|
|
684
|
+
: text;
|
|
685
|
+
|
|
678
686
|
let anySuccess = false;
|
|
679
687
|
for (const groupId of groups) {
|
|
680
688
|
try {
|
|
681
|
-
await this.sendToGroup(groupId,
|
|
689
|
+
await this.sendToGroup(groupId, payload, "联运群");
|
|
682
690
|
this.logger.message(`[联运接龙] 已发布到联运群 ${groupId}: ${name}`);
|
|
683
691
|
anySuccess = true;
|
|
684
692
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-ets2-tools-tmp",
|
|
3
3
|
"description": "欧卡2 TruckersMP信息查询、车队平台查询及活动提醒",
|
|
4
|
-
"version": "3.3.
|
|
4
|
+
"version": "3.3.65",
|
|
5
5
|
"contributors": [
|
|
6
|
-
"opwop <slhp1013@qq.com>"
|
|
7
|
-
"bot_actions <168329908@qq.com>"
|
|
6
|
+
"opwop <slhp1013@qq.com>"
|
|
8
7
|
],
|
|
9
8
|
"main": "lib/index.js",
|
|
10
9
|
"typings": "lib/index.d.ts",
|