Commit dc3ae4f0 authored by nanahira's avatar nanahira

migrate koishi v4.8

parent 6d39a8ca
...@@ -61,12 +61,10 @@ export class SendTarget { ...@@ -61,12 +61,10 @@ export class SendTarget {
}) })
channels?: ChannelTarget[]; channels?: ChannelTarget[];
getBot(bots: Adapter.BotList) { getBot(bots: Bot[]) {
if (this.bot) { return bots.find((bot) =>
return bots.get(this.bot); this.bot ? bot.sid === this.bot : !bot['parentBot'],
} else { );
return bots.find((bot) => !bot['parentBot']);
}
} }
private isOneBotBot(bot?: Bot) { private isOneBotBot(bot?: Bot) {
...@@ -97,7 +95,7 @@ export class SendTarget { ...@@ -97,7 +95,7 @@ export class SendTarget {
return ctx.intersect(this.getFilter()); return ctx.intersect(this.getFilter());
} }
async send(bots: Adapter.BotList, content: string) { async send(bots: Bot[], content: string) {
const bot = this.getBot(bots); const bot = this.getBot(bots);
if (!bot) { if (!bot) {
throw new Error(`bot ${this.bot} not found`); throw new Error(`bot ${this.bot} not found`);
......
This diff is collapsed.
...@@ -54,11 +54,12 @@ ...@@ -54,11 +54,12 @@
"typescript": "^4.6.2" "typescript": "^4.6.2"
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.7.4", "koishi": "^4.8.1",
"schemastery": "^3.4.3", "schemastery": "^3.4.3",
"schemastery-gen": "^3.1.6" "schemastery-gen": "^3.1.14"
}, },
"dependencies": { "dependencies": {
"koishi-thirdeye": "^11.0.5",
"lodash": "^4.17.21" "lodash": "^4.17.21"
} }
} }
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