Commit 818c3bc3 authored by Maiko Sinkyaet Tan's avatar Maiko Sinkyaet Tan Committed by GitHub

Merge master

parents e17ed426 547632df
Pipeline #11433 failed with stage
in 1 minute and 3 seconds
......@@ -77,15 +77,16 @@ plugins:
### 获取随机图片
```text
pic
pic [...tags:string]
获取随机图片
从各个图源中随机获取一张随机图片。图源可以用 pic.sources 查询。参数均为可选。
可用的选项有:
-s, --source <source> 指定图源,逗号分隔。图源可以用 ${this.config.commandName}.sources 查询。
-t, --tag <tag> 需要查询的图片标签,逗号分隔。
使用示例:
pic -s pixiv -t yuyuko 从 pixiv 图源中获取一张具有 yuyuko 标签的图。
pic 获取一张随机图片。
pic yuyuko 获取一张 yuyuko 标签的图片。
pic -s yande 获取一张 yande 图源的图片。
pic -s yande yuyuko saigyouji 从 yande 图源中获取一张具有 yuyuko 以及 saigyouji 标签的图。
可用的子指令有:
pic.sources 查询图源列表
```
......@@ -96,10 +97,10 @@ pic.sources 查询图源列表
pic.sources
查询图源列表
图源标签可用于图片获取的图源筛选。
可用的选项有:
-s, --source <source> 要查询的图源标签,逗号分隔。
使用示例:
pic.sources 查询全部的图源。 pic -s pixiv 查询含有 pixiv 标签的图源。
pic.sources 查询全部的图源。
pic pixiv 查询含有 pixiv 标签的图源。
```
## 配置
......
{
"name": "koishi-plugin-pics",
"version": "8.6.10",
"version": "8.7.3",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "koishi-plugin-pics",
"version": "8.6.10",
"version": "8.7.3",
"license": "MIT",
"dependencies": {
"koishi-thirdeye": "^9.2.14",
"koishi-thirdeye": "^9.2.18",
"lodash": "^4.17.21"
},
"devDependencies": {
"@koishijs/plugin-cache-lru": "^1.0.0-rc.0",
"@koishijs/plugin-console": "^3.1.2",
"@koishijs/plugin-database-memory": "^1.0.2",
"@koishijs/plugin-console": "^3.2.4",
"@koishijs/plugin-database-memory": "^1.1.0",
"@koishijs/plugin-sandbox": "^1.0.2",
"@types/jest": "^27.4.0",
"@types/lodash": "^4.14.176",
......@@ -37,7 +37,7 @@
"ws": "^8.3.0"
},
"peerDependencies": {
"koishi": "^4.4.2"
"koishi": "^4.5.0"
}
},
"node_modules/@ampproject/remapping": {
......@@ -1058,11 +1058,12 @@
}
},
"node_modules/@koishijs/core": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.4.2.tgz",
"integrity": "sha512-fLJIFQ52qjxJeKz8rpIL7ZIB46sOGu7DbXY++umVEQdn4PVdb6uVg87jdySW/VCx3VNv0gI2oFndE47fCattHg==",
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.5.0.tgz",
"integrity": "sha512-+kppTq/FcJcZf0bESunfxCAcP3xyLUK2lNaHUzP/oKJCD5L2oyGRFjl1JskRJnwwSSscUKYv409ZWCHPqJ4plA==",
"peer": true,
"dependencies": {
"@koishijs/orm": "^1.0.0",
"@koishijs/utils": "^5.2.1",
"fastest-levenshtein": "^1.0.12"
},
......@@ -1070,16 +1071,15 @@
"node": ">=12.0.0"
}
},
"node_modules/@koishijs/orm-utils": {
"node_modules/@koishijs/orm": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@koishijs/orm-utils/-/orm-utils-1.0.0.tgz",
"integrity": "sha512-Hy3ZD+jeGGp9QP+qq2D2Fq+EVnI5/YywcLu8tS7scspnzRL07PRLiU0G3dxs4PNT5vxpBfCiwmW/31sb4XrYlA==",
"dev": true,
"resolved": "https://registry.npmjs.org/@koishijs/orm/-/orm-1.0.0.tgz",
"integrity": "sha512-uWSOVCF2THR/S4PPS5FsvsYNhWcPIHO6pXVlSckV5GmJMDQ4zAppSi4s6MwvBHPRX5CMjicK/T2huUlEA/srOQ==",
"dependencies": {
"@koishijs/utils": "^5.2.1"
},
"engines": {
"node": ">=12.0.0"
},
"peerDependencies": {
"koishi": "^4.0.0-rc.3"
}
},
"node_modules/@koishijs/plugin-cache-lru": {
......@@ -1096,29 +1096,28 @@
}
},
"node_modules/@koishijs/plugin-console": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/@koishijs/plugin-console/-/plugin-console-3.1.2.tgz",
"integrity": "sha512-uRx+odKLNAbJP7h4M2/5JDXUgM6TtF1tGGYFyc9UUAaNYZ/MkS2sYyytbKQwWi5HsR5X8pC2eiTCPwlgPcYpqA==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/@koishijs/plugin-console/-/plugin-console-3.2.4.tgz",
"integrity": "sha512-R2mX0t8FyZHJb78Hh0IjewQfwKWi5WokuUKpCoLlQKSFKXLUobYi15hmN8QFe97J2TRPCyGWw7lZ7ix9HpSYgw==",
"dev": true,
"dependencies": {
"open": "^8.4.0",
"uuid": "^8.3.2",
"ws": "^8.4.2"
"ws": "^8.5.0"
},
"peerDependencies": {
"koishi": "^4.3.0"
"koishi": "^4.5.0"
}
},
"node_modules/@koishijs/plugin-database-memory": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@koishijs/plugin-database-memory/-/plugin-database-memory-1.0.2.tgz",
"integrity": "sha512-+pQm8fVTZW5d4E86H3uV3dpOcW7mw2WCMd4x0CA+RVLKiD6SCDdyI7ljkdSMQtf0j047WFAqXKYwpTQUm8h1cQ==",
"dev": true,
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@koishijs/plugin-database-memory/-/plugin-database-memory-1.1.0.tgz",
"integrity": "sha512-l6dB+HD5V7prbabdsrgZruOdkbWuv2viobcU2LCJaeTjhhqvchKFYv7SDGu4Ohz4csD/v4Y+qOELbXUar56N+Q==",
"dependencies": {
"@koishijs/orm-utils": "^1.0.0"
"@koishijs/orm": "^1.0.0"
},
"peerDependencies": {
"koishi": "^4.2.2"
"koishi": "^4.5.0"
}
},
"node_modules/@koishijs/plugin-sandbox": {
......@@ -1133,14 +1132,12 @@
"node_modules/@koishijs/segment": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@koishijs/segment/-/segment-1.1.1.tgz",
"integrity": "sha512-HmLRKJiIX++U+ow+RP0BVGwgAFzDRqwHusUzjoZcZdcnG8yudTsvB6MXnzBMnBL7k9LBxUlfB5P8ukkM1roZFQ==",
"peer": true
"integrity": "sha512-HmLRKJiIX++U+ow+RP0BVGwgAFzDRqwHusUzjoZcZdcnG8yudTsvB6MXnzBMnBL7k9LBxUlfB5P8ukkM1roZFQ=="
},
"node_modules/@koishijs/utils": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.2.1.tgz",
"integrity": "sha512-Yu+QzmpStHAx5ZknSZhp9Zv3rfy6M4b1tuU3Wh8D3gTgZPeo+gqh07X7GyN7SA76Nr472rN8+hDqq5rafuA9iQ==",
"peer": true,
"dependencies": {
"@koishijs/segment": "^1.1.1",
"schemastery": "^3.1.1",
......@@ -1151,7 +1148,6 @@
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
"peer": true,
"dependencies": {
"has-flag": "^4.0.0"
},
......@@ -5189,13 +5185,13 @@
}
},
"node_modules/koishi": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.4.2.tgz",
"integrity": "sha512-zFLRGCeLT5Jy7KSw8iSlf7S/vz2mLJ/DIlqZv4TeoE5TjSkdTkTRqBMM+2XwrHXGdKHMbQ124rMr5CGFiNSXPA==",
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.5.0.tgz",
"integrity": "sha512-1VI3Hpm304myRjx7PoV21t8E5ckB4IYFhaE6uUKVIpBBOK25zWCI1X/RwXhxqRGflL8BEpegIP0Y7Be208J+kw==",
"peer": true,
"dependencies": {
"@koa/router": "^10.1.1",
"@koishijs/core": "^4.4.2",
"@koishijs/core": "^4.5.0",
"@koishijs/utils": "^5.2.1",
"@types/koa": "*",
"@types/koa__router": "*",
......@@ -5214,9 +5210,9 @@
}
},
"node_modules/koishi-decorators": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-1.3.2.tgz",
"integrity": "sha512-akGFELeybKnjyPQbfHMGhLTRb3CigQPFTcArFt++SGQCSZ9sFpkpUS04V3/HlJoJLSKKq7pXd10q0cOPnfFYZQ==",
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-1.3.4.tgz",
"integrity": "sha512-AokyzfDz3x4eZzd8AZrX+mVAGR7BBQdoyq1xAdol+48K2Ca7Xz8USu4Whvksi/tW8VrSN+Zr3L6YbCo3wS3fmg==",
"dependencies": {
"@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11",
......@@ -5225,24 +5221,38 @@
"typed-reflector": "^1.0.10"
},
"peerDependencies": {
"koishi": "^4.4.2"
"koishi": "^4.5.0"
}
},
"node_modules/koishi-entities": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/koishi-entities/-/koishi-entities-1.0.2.tgz",
"integrity": "sha512-b5p4Tdb77ie1JFJgsYmIvZXB6CInUgIX9U7IbmDBg+ka9mfKClWmZXiYCBCuNTW71rQXsBVDdypKfm+iE0rhXQ==",
"dependencies": {
"@koishijs/plugin-database-memory": "^1.1.0",
"lodash": "^4.17.21",
"typed-reflector": "^1.0.10"
},
"peerDependencies": {
"koishi": "^4.5.0"
}
},
"node_modules/koishi-thirdeye": {
"version": "9.2.14",
"resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-9.2.14.tgz",
"integrity": "sha512-K4JK6nUnX8JqDY3OAkN43NgyWfpjHp1uVjM3LQuEr+IcUVbVPGfZ7bmHET/Ao43dc7zcfFzGTj5UrHkPwIv6wQ==",
"version": "9.2.18",
"resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-9.2.18.tgz",
"integrity": "sha512-swJaNQBnABLDOnSTMBQZp0QilpZqKphHLdPb10ryr3RExcXQiTbGwQtqNyT7Hwi9IcVTGE0x8ulTpYwQYVeetQ==",
"dependencies": {
"@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11",
"koishi-decorators": "^1.3.2",
"koishi-decorators": "^1.3.4",
"koishi-entities": "^1.0.2",
"lodash": "^4.17.21",
"reflect-metadata": "^0.1.13",
"schemastery-gen": "^3.1.2",
"typed-reflector": "^1.0.10"
},
"peerDependencies": {
"koishi": "^4.4.2",
"koishi": "^4.5.0",
"schemastery": "^3.1.0"
}
},
......@@ -6374,8 +6384,7 @@
"node_modules/schemastery": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.1.1.tgz",
"integrity": "sha512-TdbphUvailcX1FqxSq3sqlxdFx/HhBD7TXliq1r4Su7BTChRQimHvrauK/Q75jLVCYaJPACDU92s0JTovmVrtA==",
"peer": true
"integrity": "sha512-TdbphUvailcX1FqxSq3sqlxdFx/HhBD7TXliq1r4Su7BTChRQimHvrauK/Q75jLVCYaJPACDU92s0JTovmVrtA=="
},
"node_modules/schemastery-gen": {
"version": "3.1.2",
......@@ -8483,21 +8492,23 @@
}
},
"@koishijs/core": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.4.2.tgz",
"integrity": "sha512-fLJIFQ52qjxJeKz8rpIL7ZIB46sOGu7DbXY++umVEQdn4PVdb6uVg87jdySW/VCx3VNv0gI2oFndE47fCattHg==",
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.5.0.tgz",
"integrity": "sha512-+kppTq/FcJcZf0bESunfxCAcP3xyLUK2lNaHUzP/oKJCD5L2oyGRFjl1JskRJnwwSSscUKYv409ZWCHPqJ4plA==",
"peer": true,
"requires": {
"@koishijs/orm": "^1.0.0",
"@koishijs/utils": "^5.2.1",
"fastest-levenshtein": "^1.0.12"
}
},
"@koishijs/orm-utils": {
"@koishijs/orm": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@koishijs/orm-utils/-/orm-utils-1.0.0.tgz",
"integrity": "sha512-Hy3ZD+jeGGp9QP+qq2D2Fq+EVnI5/YywcLu8tS7scspnzRL07PRLiU0G3dxs4PNT5vxpBfCiwmW/31sb4XrYlA==",
"dev": true,
"requires": {}
"resolved": "https://registry.npmjs.org/@koishijs/orm/-/orm-1.0.0.tgz",
"integrity": "sha512-uWSOVCF2THR/S4PPS5FsvsYNhWcPIHO6pXVlSckV5GmJMDQ4zAppSi4s6MwvBHPRX5CMjicK/T2huUlEA/srOQ==",
"requires": {
"@koishijs/utils": "^5.2.1"
}
},
"@koishijs/plugin-cache-lru": {
"version": "1.0.0-rc.0",
......@@ -8509,23 +8520,22 @@
}
},
"@koishijs/plugin-console": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/@koishijs/plugin-console/-/plugin-console-3.1.2.tgz",
"integrity": "sha512-uRx+odKLNAbJP7h4M2/5JDXUgM6TtF1tGGYFyc9UUAaNYZ/MkS2sYyytbKQwWi5HsR5X8pC2eiTCPwlgPcYpqA==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/@koishijs/plugin-console/-/plugin-console-3.2.4.tgz",
"integrity": "sha512-R2mX0t8FyZHJb78Hh0IjewQfwKWi5WokuUKpCoLlQKSFKXLUobYi15hmN8QFe97J2TRPCyGWw7lZ7ix9HpSYgw==",
"dev": true,
"requires": {
"open": "^8.4.0",
"uuid": "^8.3.2",
"ws": "^8.4.2"
"ws": "^8.5.0"
}
},
"@koishijs/plugin-database-memory": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@koishijs/plugin-database-memory/-/plugin-database-memory-1.0.2.tgz",
"integrity": "sha512-+pQm8fVTZW5d4E86H3uV3dpOcW7mw2WCMd4x0CA+RVLKiD6SCDdyI7ljkdSMQtf0j047WFAqXKYwpTQUm8h1cQ==",
"dev": true,
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@koishijs/plugin-database-memory/-/plugin-database-memory-1.1.0.tgz",
"integrity": "sha512-l6dB+HD5V7prbabdsrgZruOdkbWuv2viobcU2LCJaeTjhhqvchKFYv7SDGu4Ohz4csD/v4Y+qOELbXUar56N+Q==",
"requires": {
"@koishijs/orm-utils": "^1.0.0"
"@koishijs/orm": "^1.0.0"
}
},
"@koishijs/plugin-sandbox": {
......@@ -8538,14 +8548,12 @@
"@koishijs/segment": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@koishijs/segment/-/segment-1.1.1.tgz",
"integrity": "sha512-HmLRKJiIX++U+ow+RP0BVGwgAFzDRqwHusUzjoZcZdcnG8yudTsvB6MXnzBMnBL7k9LBxUlfB5P8ukkM1roZFQ==",
"peer": true
"integrity": "sha512-HmLRKJiIX++U+ow+RP0BVGwgAFzDRqwHusUzjoZcZdcnG8yudTsvB6MXnzBMnBL7k9LBxUlfB5P8ukkM1roZFQ=="
},
"@koishijs/utils": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.2.1.tgz",
"integrity": "sha512-Yu+QzmpStHAx5ZknSZhp9Zv3rfy6M4b1tuU3Wh8D3gTgZPeo+gqh07X7GyN7SA76Nr472rN8+hDqq5rafuA9iQ==",
"peer": true,
"requires": {
"@koishijs/segment": "^1.1.1",
"schemastery": "^3.1.1",
......@@ -8556,7 +8564,6 @@
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
"peer": true,
"requires": {
"has-flag": "^4.0.0"
}
......@@ -11687,13 +11694,13 @@
}
},
"koishi": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.4.2.tgz",
"integrity": "sha512-zFLRGCeLT5Jy7KSw8iSlf7S/vz2mLJ/DIlqZv4TeoE5TjSkdTkTRqBMM+2XwrHXGdKHMbQ124rMr5CGFiNSXPA==",
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.5.0.tgz",
"integrity": "sha512-1VI3Hpm304myRjx7PoV21t8E5ckB4IYFhaE6uUKVIpBBOK25zWCI1X/RwXhxqRGflL8BEpegIP0Y7Be208J+kw==",
"peer": true,
"requires": {
"@koa/router": "^10.1.1",
"@koishijs/core": "^4.4.2",
"@koishijs/core": "^4.5.0",
"@koishijs/utils": "^5.2.1",
"@types/koa": "*",
"@types/koa__router": "*",
......@@ -11709,9 +11716,9 @@
}
},
"koishi-decorators": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-1.3.2.tgz",
"integrity": "sha512-akGFELeybKnjyPQbfHMGhLTRb3CigQPFTcArFt++SGQCSZ9sFpkpUS04V3/HlJoJLSKKq7pXd10q0cOPnfFYZQ==",
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-1.3.4.tgz",
"integrity": "sha512-AokyzfDz3x4eZzd8AZrX+mVAGR7BBQdoyq1xAdol+48K2Ca7Xz8USu4Whvksi/tW8VrSN+Zr3L6YbCo3wS3fmg==",
"requires": {
"@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11",
......@@ -11720,14 +11727,25 @@
"typed-reflector": "^1.0.10"
}
},
"koishi-entities": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/koishi-entities/-/koishi-entities-1.0.2.tgz",
"integrity": "sha512-b5p4Tdb77ie1JFJgsYmIvZXB6CInUgIX9U7IbmDBg+ka9mfKClWmZXiYCBCuNTW71rQXsBVDdypKfm+iE0rhXQ==",
"requires": {
"@koishijs/plugin-database-memory": "^1.1.0",
"lodash": "^4.17.21",
"typed-reflector": "^1.0.10"
}
},
"koishi-thirdeye": {
"version": "9.2.14",
"resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-9.2.14.tgz",
"integrity": "sha512-K4JK6nUnX8JqDY3OAkN43NgyWfpjHp1uVjM3LQuEr+IcUVbVPGfZ7bmHET/Ao43dc7zcfFzGTj5UrHkPwIv6wQ==",
"version": "9.2.18",
"resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-9.2.18.tgz",
"integrity": "sha512-swJaNQBnABLDOnSTMBQZp0QilpZqKphHLdPb10ryr3RExcXQiTbGwQtqNyT7Hwi9IcVTGE0x8ulTpYwQYVeetQ==",
"requires": {
"@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11",
"koishi-decorators": "^1.3.2",
"koishi-decorators": "^1.3.4",
"koishi-entities": "^1.0.2",
"lodash": "^4.17.21",
"reflect-metadata": "^0.1.13",
"schemastery-gen": "^3.1.2",
......@@ -12568,8 +12586,7 @@
"schemastery": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.1.1.tgz",
"integrity": "sha512-TdbphUvailcX1FqxSq3sqlxdFx/HhBD7TXliq1r4Su7BTChRQimHvrauK/Q75jLVCYaJPACDU92s0JTovmVrtA==",
"peer": true
"integrity": "sha512-TdbphUvailcX1FqxSq3sqlxdFx/HhBD7TXliq1r4Su7BTChRQimHvrauK/Q75jLVCYaJPACDU92s0JTovmVrtA=="
},
"schemastery-gen": {
"version": "3.1.2",
......
{
"name": "koishi-plugin-pics",
"description": "Koishi 的随机图片插件",
"version": "8.6.10",
"version": "8.7.3",
"main": "dist/index.js",
"types": "dist/src/index.d.ts",
"scripts": {
......@@ -29,13 +29,13 @@
},
"homepage": "https://github.com/koishijs/koishi-plugin-pics",
"dependencies": {
"koishi-thirdeye": "^9.2.14",
"koishi-thirdeye": "^9.2.18",
"lodash": "^4.17.21"
},
"devDependencies": {
"@koishijs/plugin-cache-lru": "^1.0.0-rc.0",
"@koishijs/plugin-console": "^3.1.2",
"@koishijs/plugin-database-memory": "^1.0.2",
"@koishijs/plugin-console": "^3.2.4",
"@koishijs/plugin-database-memory": "^1.1.0",
"@koishijs/plugin-sandbox": "^1.0.2",
"@types/jest": "^27.4.0",
"@types/lodash": "^4.14.176",
......@@ -57,7 +57,7 @@
"ws": "^8.3.0"
},
"peerDependencies": {
"koishi": "^4.4.2"
"koishi": "^4.5.0"
},
"jest": {
"moduleFileExtensions": [
......
......@@ -24,7 +24,7 @@ export interface PicSourceInfo {
}
export class PicSourceConfig implements PicSourceInfo {
constructor(config: PicSourceInfo) {}
constructor(config: Partial<PicSourceInfo>) {}
@DefineSchema({ type: 'string', default: [], description: '图源标签' })
tags: string[];
......
......@@ -216,12 +216,17 @@ export default class PicsContainer
'source',
`-s <source:string> 指定图源,逗号分隔。图源可以用 ${this.config.commandName}.sources 查询。`,
)
.example(`${this.config.commandName} 获取一张随机图片。`)
.example(`${this.config.commandName} yuyuko 获取一张 yuyuko 标签的图片。`)
.example(
`${this.config.commandName} yuyuko -s yande 从 yande 图源中获取一张具有 yuyuko 标签的图。`,
`${this.config.commandName} -s yande 获取一张 yande 图源的图片。`,
)
.example(
`${this.config.commandName} -s yande yuyuko saigyouji 从 yande 图源中获取一张具有 yuyuko 以及 saigyouji 标签的图。`,
)
.action(async (argv, ...picTags) => {
const sourceTags = argv.options.source
? argv.options.source.split(/[,+\uFF0C\uFF0B\u3001]/)
? argv.options.source.split(/[ ,+\uFF0C\uFF0B\u3001]/)
: [];
picTags ||= [];
const result = await this.randomPic(picTags, sourceTags);
......@@ -247,10 +252,8 @@ export default class PicsContainer
.subcommand('.sources [...tags:string]', '查询图源列表')
// .option('source', '-s <source:string> 要查询的图源标签,逗号分隔。')
.usage('图源标签可用于图片获取的图源筛选。')
.example(`${this.config.commandName}.sources 查询全部的图源`)
.example(
`${this.config.commandName} -s pixiv 查询含有 pixiv 标签的图源。`,
)
.example(`${this.config.commandName}.sources 查询全部的图源。`)
.example(`${this.config.commandName} pixiv 查询含有 pixiv 标签的图源。`)
.action(async (argv, ...sourceTags) => {
sourceTags ||= [];
const sources = this.pickAvailableSources(sourceTags, true);
......
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