oicq-icalingua-plus-plus 1.22.8 → 1.22.9
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/http-api/api.js +2 -2
- package/http-api/core.js +1 -1
- package/index.d.ts +1 -1
- package/lib/client-ext.js +1 -1
- package/lib/client.js +1 -1
- package/package.json +3 -3
package/http-api/api.js
CHANGED
|
@@ -6,7 +6,7 @@ let bot;
|
|
|
6
6
|
class NotFoundError extends Error {}
|
|
7
7
|
|
|
8
8
|
const available_actions = [
|
|
9
|
-
"
|
|
9
|
+
"_sendPrivateMsg",
|
|
10
10
|
"sendGroupMsg",
|
|
11
11
|
"sendDiscussMsg",
|
|
12
12
|
"sendMsg",
|
|
@@ -116,7 +116,7 @@ function toHump(action) {
|
|
|
116
116
|
|
|
117
117
|
function quickOperate(event, res) {
|
|
118
118
|
if (event.post_type === "message" && res.reply) {
|
|
119
|
-
const action = event.message_type === "private" ? "
|
|
119
|
+
const action = event.message_type === "private" ? "_sendPrivateMsg" : "sendGroupMsg";
|
|
120
120
|
const id = event.message_type === "private" ? event.user_id : event.group_id;
|
|
121
121
|
bot[action](id, res.reply, res.auto_escape);
|
|
122
122
|
if (event.group_id) {
|
package/http-api/core.js
CHANGED
package/index.d.ts
CHANGED
|
@@ -933,7 +933,7 @@ export class Client extends EventEmitter {
|
|
|
933
933
|
getGroupInfo(group_id: number, no_cache?: boolean): Promise<Ret<GroupInfo>>;
|
|
934
934
|
|
|
935
935
|
/** 私聊 */
|
|
936
|
-
|
|
936
|
+
_sendPrivateMsg(user_id: number, message: Sendable, auto_escape?: boolean): Promise<Ret<{ message_id: string }>>;
|
|
937
937
|
/** 群聊 */
|
|
938
938
|
sendGroupMsg(group_id: number, message: Sendable, auto_escape?: boolean): Promise<Ret<{ message_id: string }>>;
|
|
939
939
|
/** 群临时会话,大多数时候可以使用私聊达到同样效果 */
|
package/lib/client-ext.js
CHANGED
|
@@ -288,7 +288,7 @@ Client.prototype.pbGetMsg = async function () {
|
|
|
288
288
|
try {
|
|
289
289
|
const data = await parseC2CMsg.call(this, msg, true);
|
|
290
290
|
if (data && data.raw_message) {
|
|
291
|
-
data.reply = (message, auto_escape = false) => this.
|
|
291
|
+
data.reply = (message, auto_escape = false) => this._sendPrivateMsg(data.user_id, message, auto_escape);
|
|
292
292
|
this.logger.info(`recv from: [Private: ${data.user_id}(${data.sub_type})] ` + data.raw_message);
|
|
293
293
|
this.em("message.private." + data.sub_type, data);
|
|
294
294
|
}
|
package/lib/client.js
CHANGED
|
@@ -348,7 +348,7 @@ class Client extends EventEmitter {
|
|
|
348
348
|
|
|
349
349
|
///////////////////////////////////////////////////
|
|
350
350
|
|
|
351
|
-
|
|
351
|
+
_sendPrivateMsg(user_id, message = "", auto_escape = false) {
|
|
352
352
|
return this._useProtocol(chat.sendMsg, [user_id, message, auto_escape, 0]);
|
|
353
353
|
}
|
|
354
354
|
sendGroupMsg(group_id, message = "", auto_escape = false) {
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oicq-icalingua-plus-plus",
|
|
3
3
|
"app_name": "oicq-icalingua-plus-plus",
|
|
4
|
-
"version": "1.22.
|
|
5
|
-
"app_version": "1.22.
|
|
6
|
-
"upday": "2022/
|
|
4
|
+
"version": "1.22.9",
|
|
5
|
+
"app_version": "1.22.9",
|
|
6
|
+
"upday": "2022/09/06",
|
|
7
7
|
"protocol_version": "v11",
|
|
8
8
|
"description": "oicq(https://github.com/takayama-lily/oicq) v1 for Icalingua++",
|
|
9
9
|
"main": "index.js",
|