Commit 1a8cc3ef authored by nanahira's avatar nanahira

bump

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