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
60d03b46
Commit
60d03b46
authored
Dec 05, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename
parent
96490bd2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
src/config.ts
src/config.ts
+3
-3
src/plugin.ts
src/plugin.ts
+2
-2
No files found.
src/config.ts
View file @
60d03b46
...
@@ -24,7 +24,7 @@ export interface PicSourceInfo {
...
@@ -24,7 +24,7 @@ export interface PicSourceInfo {
weight
?:
number
;
weight
?:
number
;
name
:
string
;
name
:
string
;
description
?:
string
;
description
?:
string
;
d
efault
?:
boolean
;
isD
efault
?:
boolean
;
}
}
export
class
PicSourceConfig
implements
PicSourceInfo
{
export
class
PicSourceConfig
implements
PicSourceInfo
{
...
@@ -37,7 +37,7 @@ export class PicSourceConfig implements PicSourceInfo {
...
@@ -37,7 +37,7 @@ export class PicSourceConfig implements PicSourceInfo {
@
DefineSchema
({
description
:
'
图源描述
'
})
@
DefineSchema
({
description
:
'
图源描述
'
})
description
?:
string
;
description
?:
string
;
@
DefineSchema
({
description
:
'
是否为默认图源
'
})
@
DefineSchema
({
description
:
'
是否为默认图源
'
})
d
efault
?:
boolean
;
isD
efault
?:
boolean
;
// 给目标对象注入上述对象。
// 给目标对象注入上述对象。
applyTo
(
target
:
PicSourceInfo
)
{
applyTo
(
target
:
PicSourceInfo
)
{
...
@@ -45,7 +45,7 @@ export class PicSourceConfig implements PicSourceInfo {
...
@@ -45,7 +45,7 @@ export class PicSourceConfig implements PicSourceInfo {
target
.
weight
=
this
.
weight
;
target
.
weight
=
this
.
weight
;
target
.
name
=
this
.
name
;
target
.
name
=
this
.
name
;
target
.
description
=
this
.
description
;
target
.
description
=
this
.
description
;
target
.
default
=
this
.
d
efault
;
target
.
isDefault
=
this
.
isD
efault
;
}
}
}
}
...
...
src/plugin.ts
View file @
60d03b46
...
@@ -28,7 +28,7 @@ export class PicSource implements PicSourceInfo {
...
@@ -28,7 +28,7 @@ export class PicSource implements PicSourceInfo {
weight
=
1
;
weight
=
1
;
name
=
'
default
'
;
name
=
'
default
'
;
description
=
''
;
description
=
''
;
d
efault
=
false
;
isD
efault
=
false
;
randomPic
(
picTags
:
string
[]):
Awaitable
<
PicResult
>
{
randomPic
(
picTags
:
string
[]):
Awaitable
<
PicResult
>
{
// For override
// For override
throw
new
Error
(
`Not implemented`
);
throw
new
Error
(
`Not implemented`
);
...
@@ -95,7 +95,7 @@ export class PicsContainer {
...
@@ -95,7 +95,7 @@ export class PicsContainer {
sourceTags
.
every
((
t
)
=>
s
.
tags
.
includes
(
t
)),
sourceTags
.
every
((
t
)
=>
s
.
tags
.
includes
(
t
)),
);
);
}
else
if
(
!
includeNonDefault
)
{
}
else
if
(
!
includeNonDefault
)
{
sources
=
sources
.
filter
((
s
)
=>
s
.
d
efault
);
sources
=
sources
.
filter
((
s
)
=>
s
.
isD
efault
);
}
}
return
sources
;
return
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