Commit a572459d authored by nanahira's avatar nanahira

selfid problem

parent f85f6ea5
......@@ -50,7 +50,7 @@ export class Show {
if (matchGroup) {
availableBots.push(bot);
botNameMap.set(
bot.selfId,
bot.selfId.toString(),
(await bot.$getGroupMemberInfo(this.groupId, bot.selfId)).nickname,
);
}
......@@ -58,18 +58,18 @@ export class Show {
for (const character of this.playbook.characters) {
// exact
let matchBot = availableBots.find(
(b) => botNameMap.get(b.selfId) === character.name,
(b) => botNameMap.get(b.selfId.toString()) === character.name,
);
// match 1
if (!matchBot) {
matchBot = availableBots.find((b) =>
botNameMap.get(b.selfId).includes(character.name),
botNameMap.get(b.selfId.toString()).includes(character.name),
);
}
// match 2
if (!matchBot) {
matchBot = availableBots.find((b) =>
character.name.includes(botNameMap.get(b.selfId)),
character.name.includes(botNameMap.get(b.selfId.toString())),
);
}
if (matchBot) {
......
......@@ -119,7 +119,7 @@ export class MyPlugin {
if (!botId) {
return `非法指定人物格式: ${specificCharacter}`;
}
const bot = bots.find((b) => b.selfId === botId);
const bot = bots.find((b) => b.selfId.toString() === 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