koishi-plugin-adapter-onebot-multi 1.0.4 → 1.0.5

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.d.ts CHANGED
@@ -70,7 +70,7 @@ declare module 'koishi' {
70
70
  'onebot-multi/bot-offline'(bot: OneBotBot): void;
71
71
  }
72
72
  }
73
- declare module '@satorijs/core' {
73
+ declare module 'koishi' {
74
74
  interface Session {
75
75
  onebot?: OneBot.Payload & OneBot.Internal;
76
76
  }
package/lib/index.js CHANGED
@@ -146,7 +146,7 @@ var Internal = class _Internal {
146
146
  static prepareArg(name2, params, args) {
147
147
  const fixedArg = Object.fromEntries(params.map((name3, index) => [name3, args[index]]));
148
148
  for (const key in fixedArg) {
149
- if (!name2.includes("guild") && key.endsWith("_id")) {
149
+ if (!name2.includes("guild") && key.endsWith("_id") && key !== "message_id") {
150
150
  const value = +fixedArg[key];
151
151
  if (Math.abs(value) < 4294967296) {
152
152
  fixedArg[key] = value;
@@ -350,9 +350,15 @@ async function adaptMessage(bot, data, message = {}, payload = message) {
350
350
  const [guildId, channelId] = decodeGuildChannelId(data);
351
351
  if (message.elements[0]?.type === "reply") {
352
352
  const reply = message.elements.shift();
353
- message.quote = await bot.getMessage(channelId, reply.attrs.id).catch((error) => {
354
- bot.logger.warn(error);
355
- return void 0;
353
+ const replyId = String(reply.attrs.id);
354
+ message.quote = await bot.getMessage(channelId, replyId).catch((error) => {
355
+ bot.logger.warn(
356
+ "failed to fetch quoted message %s in %s: %s",
357
+ replyId,
358
+ channelId,
359
+ error?.message || error
360
+ );
361
+ return { id: replyId };
356
362
  });
357
363
  }
358
364
  message.content = message.elements.join("");
@@ -496,6 +502,7 @@ async function adaptSession(bot, data) {
496
502
  if (session.subtype === "poke") {
497
503
  session.channelId ||= `private:${session.userId}`;
498
504
  } else if (session.subtype === "honor") {
505
+ ;
499
506
  session.subsubtype = (0, import_koishi2.hyphenate)(data.honor_type);
500
507
  }
501
508
  break;
@@ -2128,7 +2135,7 @@ var ConfigStore = class {
2128
2135
  };
2129
2136
 
2130
2137
  // src/index.ts
2131
- var Config = import_koishi9.Schema.object({}).description("配置已迁移到 data/adapter-onebot-multi/config.yaml");
2138
+ var Config = import_koishi9.Schema.object({}).description("在侧边栏webui使用,配置文件在data/adapter-onebot-multi/config.yaml");
2132
2139
  var name = "adapter-onebot-multi";
2133
2140
  var inject = {
2134
2141
  required: ["server", "database"],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-adapter-onebot-multi",
3
3
  "description": "奶龙bot定制版onebot适配器,支持自动负载均衡与黑白名单,控制台侧边栏管理",
4
- "version": "1.0.4",
4
+ "version": "1.0.5",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -39,13 +39,14 @@
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@koishijs/plugin-console": "^5.30.0",
42
- "koishi": "^4.18.6"
42
+ "koishi": "*"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@koishijs/client": "^5.30.0",
46
46
  "@koishijs/plugin-console": "^5.30.8",
47
47
  "@koishijs/plugin-server": "^3.2.4",
48
- "@types/node": "^22.7.5"
48
+ "@types/node": "^22.7.5",
49
+ "koishi": "^4.18.11"
49
50
  },
50
51
  "dependencies": {
51
52
  "qface": "^1.4.1",