@lih-x-x/kmr 1.0.38 → 1.0.39
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/dist/cli.js +3 -3
- package/dist/index.js +31 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -6,9 +6,9 @@ async function checkUpdate() {
|
|
|
6
6
|
try {
|
|
7
7
|
const res = await fetch(`https://registry.npmjs.org/${"@lih-x-x/kmr"}/latest`, { signal: AbortSignal.timeout(3e3) });
|
|
8
8
|
const data = await res.json();
|
|
9
|
-
if (data.version && data.version !== "1.0.
|
|
9
|
+
if (data.version && data.version !== "1.0.39") {
|
|
10
10
|
console.log(`
|
|
11
|
-
\u2B06\uFE0F \u65B0\u7248\u672C\u53EF\u7528: ${"1.0.
|
|
11
|
+
\u2B06\uFE0F \u65B0\u7248\u672C\u53EF\u7528: ${"1.0.39"} \u2192 ${data.version}`);
|
|
12
12
|
console.log(` \u8FD0\u884C npm install -g ${"@lih-x-x/kmr"} \u66F4\u65B0
|
|
13
13
|
`);
|
|
14
14
|
}
|
|
@@ -55,7 +55,7 @@ KMR\uFF08Key Meetings Record\uFF09\u2014 \u4F1A\u8BAE\u6316\u6398\u673A
|
|
|
55
55
|
kmr --help \u663E\u793A\u5E2E\u52A9
|
|
56
56
|
`);
|
|
57
57
|
} else if (command === "--version" || command === "-v") {
|
|
58
|
-
console.log("1.0.
|
|
58
|
+
console.log("1.0.39");
|
|
59
59
|
} else if (command === "list") {
|
|
60
60
|
const { loadConfig } = await import("./config-L2SVVMAR.js");
|
|
61
61
|
const { JsonStore } = await import("./jsonStore-AL73KEUG.js");
|
package/dist/index.js
CHANGED
|
@@ -259,6 +259,35 @@ var Messenger = class {
|
|
|
259
259
|
}
|
|
260
260
|
await this.replyText(messageId, lines.join("\n"));
|
|
261
261
|
}
|
|
262
|
+
/**
|
|
263
|
+
* 给消息添加表情回应(Reaction)
|
|
264
|
+
*/
|
|
265
|
+
async addReaction(messageId, emojiType) {
|
|
266
|
+
await this.client.im.messageReaction.create({
|
|
267
|
+
path: { message_id: messageId },
|
|
268
|
+
data: { reaction_type: { emoji_type: emojiType } }
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* 删除消息上的表情回应
|
|
273
|
+
*/
|
|
274
|
+
async removeReaction(messageId, emojiType) {
|
|
275
|
+
try {
|
|
276
|
+
const res = await this.client.im.messageReaction.list({
|
|
277
|
+
path: { message_id: messageId }
|
|
278
|
+
});
|
|
279
|
+
const reactions = res.data?.reaction_list || [];
|
|
280
|
+
for (const r of reactions) {
|
|
281
|
+
if (r.reaction_type?.emoji_type === emojiType) {
|
|
282
|
+
await this.client.im.messageReaction.delete({
|
|
283
|
+
path: { message_id: messageId, reaction_id: r.reaction_id }
|
|
284
|
+
});
|
|
285
|
+
break;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
} catch {
|
|
289
|
+
}
|
|
290
|
+
}
|
|
262
291
|
/**
|
|
263
292
|
* 主动向指定用户发送消息(不需要先收到消息)
|
|
264
293
|
*/
|
|
@@ -963,8 +992,9 @@ async function main() {
|
|
|
963
992
|
break;
|
|
964
993
|
}
|
|
965
994
|
console.log(`[process] \u81EA\u7531\u5BF9\u8BDD, userId=${senderId}`);
|
|
966
|
-
await messenger.
|
|
995
|
+
await messenger.addReaction(messageId, "OnIt");
|
|
967
996
|
const reply = await sessionManager.handleMessage(senderId, text);
|
|
997
|
+
await messenger.removeReaction(messageId, "OnIt");
|
|
968
998
|
await messenger.replyText(messageId, reply);
|
|
969
999
|
break;
|
|
970
1000
|
}
|