Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
koishi-plugin-pics
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
3rdeye
koishi-plugin-pics
Commits
16bc8501
Commit
16bc8501
authored
Mar 27, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs
parent
d010465c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
12 deletions
+17
-12
README.md
README.md
+8
-6
src/index.ts
src/index.ts
+9
-6
No files found.
README.md
View file @
16bc8501
...
...
@@ -66,14 +66,16 @@ plugins:
### 获取随机图片
```
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 查询图源列表
```
...
...
@@ -84,10 +86,10 @@ pic.sources 查询图源列表
pic.sources
查询图源列表
图源标签可用于图片获取的图源筛选。
可用的选项有:
-s, --source <source> 要查询的图源标签,逗号分隔。
使用示例:
pic.sources 查询全部的图源。 pic -s pixiv 查询含有 pixiv 标签的图源。
pic.sources 查询全部的图源。
pic pixiv 查询含有 pixiv 标签的图源。
```
## 配置
...
...
src/index.ts
View file @
16bc8501
...
...
@@ -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
(
/
[
,+
\u
FF0C
\u
FF0B
\u
3001
]
/
)
?
argv
.
options
.
source
.
split
(
/
[
,+
\u
FF0C
\u
FF0B
\u
3001
]
/
)
:
[];
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment