Commit 1a8cc3ef authored by nanahira's avatar nanahira

bump

parent cc28b40e
This diff is collapsed.
......@@ -28,16 +28,16 @@
"homepage": "https://code.mycard.moe/3rdeye/koishi-plugin-ygocard",
"dependencies": {
"class-transformer": "^0.5.1",
"koishi-thirdeye": "^11.1.20",
"koishi-thirdeye": "^11.1.21",
"leven": "3.1",
"lodash": "^4.17.21",
"mustache": "^4.2.0",
"sql.js": "^1.8.0"
},
"devDependencies": {
"@koishijs/plugin-console": "^5.0.2",
"@koishijs/plugin-database-memory": "^2.2.0",
"@koishijs/plugin-help": "^2.0.1",
"@koishijs/plugin-console": "^5.1.0",
"@koishijs/plugin-database-memory": "^2.2.2",
"@koishijs/plugin-help": "^2.0.2",
"@koishijs/plugin-sandbox": "^2.5.0",
"@types/jest": "^29.2.0",
"@types/lodash": "^4.14.175",
......@@ -62,7 +62,7 @@
"ws": "^8.3.0"
},
"peerDependencies": {
"koishi": "^4.11.0"
"koishi": "^4.11.1"
},
"jest": {
"moduleFileExtensions": [
......
......@@ -94,7 +94,7 @@ export default class YGOCardPlugin
@PutSession() session: Session,
) {
if (!query) {
await session.send(<i18n path={'.prompt-input'} />);
await session.send(session.text('.prompt-input'));
query = await session.prompt();
}
if (!query) return;
......@@ -103,7 +103,7 @@ export default class YGOCardPlugin
}
const cards = this.queryInAllDBs(query, count);
if (!cards.length) {
return <i18n path={'.not-found'} />;
return session.text('.not-found');
}
if (cards.length === 1) {
return cards[0].getDisplayString(this.config);
......@@ -111,19 +111,17 @@ export default class YGOCardPlugin
const itemLines = cards.map((c, i) => `${i + 1}. ${c.getIdAndName()}`);
const borderLength = Math.max(...itemLines.map((l) => l.length)) + 1;
await session.send(
<>
<i18n path={'.select-prefix-part1'} />
{query}
<i18n path={'.select-prefix-part2'} />
{'\n'}
{_.repeat('-', borderLength)}
{'\n'}
{itemLines.join('\n')}
{'\n'}
{_.repeat('-', borderLength)}
{'\n'}
<i18n path={'.select-suffix'} />
</>,
session.text('.select-prefix-part1') +
query +
session.text('.select-prefix-part2') +
'\n' +
_.repeat('-', borderLength) +
'\n' +
itemLines.join('\n') +
'\n' +
_.repeat('-', borderLength) +
'\n' +
session.text('.select-suffix')
);
const reply = await session.prompt();
if (!reply) {
......@@ -137,7 +135,7 @@ export default class YGOCardPlugin
cards.find((c) => c.name.includes(reply)) ||
cards.find((c) => c.desc.includes(reply));
if (!card) {
return <i18n path={'.not-found'} />;
return session.text('.not-found');
}
return card.getDisplayString(this.config);
}
......
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