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
d010465c
Commit
d010465c
authored
Mar 26, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean
parent
b1bf76f8
Pipeline
#11163
failed with stage
in 48 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
16 deletions
+3
-16
src/index.ts
src/index.ts
+3
-16
No files found.
src/index.ts
View file @
d010465c
...
...
@@ -181,7 +181,6 @@ export default class PicsContainer
description
:
'
获取随机图片
'
,
options
:
{
source
:
`指定图源,逗号分隔。图源可以用
${
this
.
config
.
commandName
}
.sources 查询。`
,
// tag: '需要查询的图片标签,逗号分隔。',
},
messages
:
{
'
not-found
'
:
'
未找到任何图片。
'
,
...
...
@@ -189,28 +188,21 @@ export default class PicsContainer
});
ctx
.
i18n
.
define
(
'
en
'
,
`commands.
${
this
.
config
.
commandName
}
`
,
{
description
:
'
Get random picture
'
,
options
:
{
source
:
`Specify picture source. Sources can be queried by command
${
this
.
config
.
commandName
}
.sources`
,
// tag: 'Tags to search for, separated by comma.',
},
options
:
{},
messages
:
{
'
not-found
'
:
'
No pictures found.
'
,
},
});
ctx
.
i18n
.
define
(
'
zh
'
,
`commands.
${
this
.
config
.
commandName
}
.sources`
,
{
description
:
'
查询图源列表
'
,
options
:
{
// source: '要查询的图源标签,逗号分隔。',
},
options
:
{},
messages
:
{
list
:
'
图源的列表如下:
'
,
},
});
ctx
.
i18n
.
define
(
'
en
'
,
`commands.
${
this
.
config
.
commandName
}
.sources`
,
{
description
:
'
Query picture sources
'
,
options
:
{
// source: 'Tags to search for, separated by comma.',
},
options
:
{},
messages
:
{
list
:
'
List of sources:
'
,
},
...
...
@@ -224,7 +216,6 @@ export default class PicsContainer
'
source
'
,
`-s <source:string> 指定图源,逗号分隔。图源可以用
${
this
.
config
.
commandName
}
.sources 查询。`
,
)
// .option('tag', '-t <tag:string> 需要查询的图片标签,逗号分隔。')
.
example
(
`
${
this
.
config
.
commandName
}
yuyuko -s yande 从 yande 图源中获取一张具有 yuyuko 标签的图。`
,
)
...
...
@@ -232,7 +223,6 @@ export default class PicsContainer
const
sourceTags
=
argv
.
options
.
source
?
argv
.
options
.
source
.
split
(
/
[
,+
\u
FF0C
\u
FF0B
\u
3001
]
/
)
:
[];
// const picTags = argv.options.tag ? argv.options.tag.split(',') : [];
picTags
||=
[];
const
result
=
await
this
.
randomPic
(
picTags
,
sourceTags
);
if
(
!
result
)
{
...
...
@@ -262,9 +252,6 @@ export default class PicsContainer
`
${
this
.
config
.
commandName
}
-s pixiv 查询含有 pixiv 标签的图源。`
,
)
.
action
(
async
(
argv
,
...
sourceTags
)
=>
{
//const sourceTags = argv.options.source
// ? argv.options.source.split(',')
// : [];
sourceTags
||=
[];
const
sources
=
this
.
pickAvailableSources
(
sourceTags
,
true
);
return
`
${
argv
.
session
.
text
(
'
.list
'
)}
\n
${
sources
...
...
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