koishi-plugin-cs2-server-query 1.5.1 → 1.6.0
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.
- package/lib/index.js +5 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -674,11 +674,14 @@ ${subscriptionList}`;
|
|
|
674
674
|
});
|
|
675
675
|
async function sendMessageToTarget(ctx2, targetId, pushType, message, userId) {
|
|
676
676
|
try {
|
|
677
|
+
if (pushType === "群聊" && userId) {
|
|
678
|
+
message = [import_koishi.h.at(userId), ...Array.isArray(message) ? message : [message]];
|
|
679
|
+
}
|
|
677
680
|
if (Array.isArray(message)) {
|
|
678
681
|
const combinedMessage = (0, import_koishi.h)("message", message);
|
|
679
|
-
await sendSingleMessage(ctx2, targetId, pushType, combinedMessage
|
|
682
|
+
await sendSingleMessage(ctx2, targetId, pushType, combinedMessage);
|
|
680
683
|
} else {
|
|
681
|
-
await sendSingleMessage(ctx2, targetId, pushType, message
|
|
684
|
+
await sendSingleMessage(ctx2, targetId, pushType, message);
|
|
682
685
|
}
|
|
683
686
|
} catch (err) {
|
|
684
687
|
ctx2.logger("cs2-server-query").error(`发送消息失败: ${err.message}`);
|