onebots 0.4.67 → 0.4.68

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.
@@ -1,5 +1,4 @@
1
1
  import { V11 } from "../../../service/V11";
2
- import { Message } from "@icqqjs/icqq";
3
2
  export declare class CommonAction {
4
3
  /**
5
4
  * 获取登录信息
@@ -18,7 +17,7 @@ export declare class CommonAction {
18
17
  * @param message_id {string} 消息id
19
18
  * @param onebot_id {number}
20
19
  */
21
- getMsg(this: V11, message_id: number): Promise<Message>;
20
+ getMsg(this: V11, message_id: number): Promise<V11.MessageRet>;
22
21
  /**
23
22
  * 获取合并消息
24
23
  * @param id {string} 合并id
@@ -32,7 +32,9 @@ class CommonAction {
32
32
  */
33
33
  async getMsg(message_id) {
34
34
  const msg_id = this.getStrByInt("message_id", message_id);
35
- let msg = await this.adapter.call(this.oneBot.uin, "V11", "getMessage", [msg_id]);
35
+ let msg = await this.adapter.call(this.oneBot.uin, "V11", "getMessage", [
36
+ msg_id,
37
+ ]);
36
38
  msg.message_id = message_id; // nonebot v11 要求 message_id 是 number 类型
37
39
  msg["real_id"] = msg.message_id; // nonebot 的reply类型会检测real_id是否存在,虽然它从未使用
38
40
  return msg;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="node" />
2
- import { EventMap } from "@icqqjs/icqq";
3
2
  import { Config } from "./config";
4
3
  import { OneBot } from "../../onebot";
5
4
  import { Action } from "./action";
@@ -141,16 +140,6 @@ export declare namespace V12 {
141
140
  detail_type: "status_update";
142
141
  status: ReturnType<Action["getStatus"]>;
143
142
  };
144
- } & TransformEventMap;
145
- type TransformEventMap = {
146
- [P in keyof EventMap]: TransformEventParams<Parameters<EventMap[P]>>;
147
- };
148
- type TransformEventParams<T extends any[]> = T extends [infer L, ...infer R] ? L extends object ? L & {
149
- args: R;
150
- } : {
151
- args: [L, ...R];
152
- } : {
153
- args: T;
154
143
  };
155
144
  function success<T extends any>(data: T, retcode?: Result<T>["retcode"], echo?: string): Result<T>;
156
145
  function error(message: string, retcode?: Result<null>["retcode"], echo?: string): Result<null>;
@@ -14,7 +14,6 @@ const https_1 = __importDefault(require("https"));
14
14
  const ws_1 = require("ws");
15
15
  const utils_2 = require("../../utils");
16
16
  const db_1 = require("../../db");
17
- const message_1 = require("@icqqjs/icqq/lib/message");
18
17
  const service_1 = require("../../service");
19
18
  const app_1 = require("../../server/app");
20
19
  class V12 extends service_1.Service {
@@ -353,15 +352,6 @@ class V12 extends service_1.Service {
353
352
  data.message_type || data.notice_type || data.request_type || data.system_type;
354
353
  data.message =
355
354
  data.type === "message" ? this.adapter.toSegment("V12", data.message) : data.message;
356
- if (data.source)
357
- data.source = {
358
- ...data.source,
359
- message_id: data.detail_type === "private"
360
- ? (0, message_1.genDmMessageId)(data.source.user_id, data.source.seq, data.source.rand, data.source.time)
361
- : (0, message_1.genGroupMessageId)(data.group_id, data.source.user_id, data.source.seq, data.source.rand, data.source.time),
362
- user_id: data.source.user_id,
363
- message: data.source.message,
364
- };
365
355
  return V12.formatPayload(this.oneBot.uin, event, data);
366
356
  }
367
357
  system_online(data) { }
@@ -403,7 +393,7 @@ class V12 extends service_1.Service {
403
393
  }
404
394
  transformMedia(segment) {
405
395
  const file = this.getFile(segment.data.file_id);
406
- if (file)
396
+ if (file && file.data)
407
397
  return {
408
398
  type: segment.type,
409
399
  data: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onebots",
3
- "version": "0.4.67",
3
+ "version": "0.4.68",
4
4
  "description": "基于icqq的多例oneBot实现",
5
5
  "main": "lib/index.js",
6
6
  "bin": {