Commit c5726a5e authored by nanahira's avatar nanahira

bump to Koishi 4.9.7

parent 3156a183
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -15,14 +15,14 @@
"reflect-metadata": "^0.1.13"
},
"peerDependencies": {
"@koishijs/plugin-adapter-onebot": "^5.0.6",
"koishi": "^4.9.1"
"@koishijs/plugin-adapter-onebot": "^5.3.3",
"koishi": "^4.9.7"
},
"devDependencies": {
"@koishijs/plugin-console": "^4.5.4",
"@koishijs/plugin-database-memory": "^1.5.0",
"@koishijs/plugin-sandbox": "^2.2.9",
"@types/jest": "^27.4.0",
"@types/jest": "^29.2.0",
"@types/lodash": "^4.14.172",
"@types/mustache": "^4.1.2",
"@types/node": "^16.4.11",
......@@ -32,12 +32,12 @@
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"jest": "^27.5.1",
"jest": "^29.2.2",
"raw-loader": "^4.0.2",
"ts-jest": "^27.1.3",
"ts-jest": "^29.0.3",
"ts-loader": "^9.3.1",
"ts-node": "^10.9.1",
"typescript": "^4.8.2",
"typescript": "^4.8.4",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"ws": "^8.3.0"
......
......@@ -50,7 +50,7 @@ export class Show {
if (matchGroup) {
availableBots.push(bot);
botNameMap.set(
bot.selfId.toString(),
bot.selfId,
(await bot.getGuildMember(this.groupId, bot.selfId)).nickname,
);
}
......@@ -64,18 +64,18 @@ export class Show {
}
// exact
let matchBot = availableBots.find(
(b) => botNameMap.get(b.selfId.toString()) === character.name,
(b) => botNameMap.get(b.selfId) === character.name,
);
// match 1
if (!matchBot) {
matchBot = availableBots.find((b) =>
botNameMap.get(b.selfId.toString()).includes(character.name),
botNameMap.get(b.selfId).includes(character.name),
);
}
// match 2
if (!matchBot) {
matchBot = availableBots.find((b) =>
character.name.includes(botNameMap.get(b.selfId.toString())),
character.name.includes(botNameMap.get(b.selfId)),
);
}
if (matchBot) {
......@@ -157,7 +157,7 @@ export class Show {
([characterId, bot]) =>
`${this.playbook.characters
.find((c) => c.id === characterId)
.getDisplayName()} => ${bot.selfId}`,
.getDisplayName()} => ${bot.userId}`,
)
.join('\n');
}
......
......@@ -4,7 +4,7 @@ import { Show } from './playbook/Show';
import { Playbook } from './playbook/Playbook';
import { plainToClass } from 'class-transformer';
import loadJsonFile from 'load-json-file';
import type { OneBotBot } from '@koishijs/plugin-adapter-onebot';
import type OneBotBot from '@koishijs/plugin-adapter-onebot';
export interface PluginConfig {
autoChangeName?: boolean;
......@@ -116,7 +116,7 @@ export class MyPlugin {
if (!botId) {
return `非法指定人物格式: ${specificCharacter}`;
}
const bot = bots.find((b) => b.selfId.toString() === botId);
const bot = bots.find((b) => b.selfId === botId);
if (!bot) {
return `没有找到机器人 ${botId}`;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment