Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
koishi-plugin-tabulate
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-tabulate
Commits
5c379552
Commit
5c379552
authored
Dec 04, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
catchup
parent
2fa4c8ca
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
84 deletions
+69
-84
package-lock.json
package-lock.json
+61
-76
package.json
package.json
+3
-3
src/config.ts
src/config.ts
+1
-1
src/index.ts
src/index.ts
+4
-4
No files found.
package-lock.json
View file @
5c379552
This diff is collapsed.
Click to expand it.
package.json
View file @
5c379552
...
@@ -29,13 +29,13 @@
...
@@ -29,13 +29,13 @@
"homepage"
:
"
https://code.mycard.moe/3rdeye/koishi-plugin-tabulate
"
,
"homepage"
:
"
https://code.mycard.moe/3rdeye/koishi-plugin-tabulate
"
,
"dependencies"
:
{
"dependencies"
:
{
"
class-transformer
"
:
"
^0.4.0
"
,
"
class-transformer
"
:
"
^0.4.0
"
,
"
koishi-thirdeye
"
:
"
^4.
0.0
"
,
"
koishi-thirdeye
"
:
"
^4.
2.2
"
,
"
lodash
"
:
"
^4.17.21
"
,
"
lodash
"
:
"
^4.17.21
"
,
"
moment
"
:
"
^2.29.1
"
,
"
moment
"
:
"
^2.29.1
"
,
"
source-map-support
"
:
"
^0.5.20
"
"
source-map-support
"
:
"
^0.5.20
"
},
},
"peerDependencies"
:
{
"peerDependencies"
:
{
"
koishi
"
:
"
^4.0.0-beta.
3
"
"
koishi
"
:
"
^4.0.0-beta.
4
"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"
@types/lodash
"
:
"
^4.14.176
"
,
"
@types/lodash
"
:
"
^4.14.176
"
,
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
"
eslint
"
:
"
^7.32.0
"
,
"
eslint
"
:
"
^7.32.0
"
,
"
eslint-config-prettier
"
:
"
^8.3.0
"
,
"
eslint-config-prettier
"
:
"
^8.3.0
"
,
"
eslint-plugin-prettier
"
:
"
^3.4.1
"
,
"
eslint-plugin-prettier
"
:
"
^3.4.1
"
,
"
koishi
"
:
"
^4.0.0-beta.
3
"
,
"
koishi
"
:
"
^4.0.0-beta.
4
"
,
"
prettier
"
:
"
^2.4.1
"
,
"
prettier
"
:
"
^2.4.1
"
,
"
raw-loader
"
:
"
^4.0.2
"
,
"
raw-loader
"
:
"
^4.0.2
"
,
"
ts-loader
"
:
"
^9.2.6
"
,
"
ts-loader
"
:
"
^9.2.6
"
,
...
...
src/config.ts
View file @
5c379552
...
@@ -3,7 +3,7 @@ import { DefineSchema, RegisterSchema } from 'koishi-thirdeye';
...
@@ -3,7 +3,7 @@ import { DefineSchema, RegisterSchema } from 'koishi-thirdeye';
@
RegisterSchema
()
@
RegisterSchema
()
export
class
TabulatePluginConfig
{
export
class
TabulatePluginConfig
{
@
DefineSchema
({
desc
:
'
比赛的超时时间
'
,
default
:
7200000
})
@
DefineSchema
({
desc
ription
:
'
比赛的超时时间
'
,
default
:
7200000
})
saveTime
:
number
;
saveTime
:
number
;
}
}
...
...
src/index.ts
View file @
5c379552
...
@@ -14,6 +14,7 @@ import {
...
@@ -14,6 +14,7 @@ import {
PutOption
,
PutOption
,
CommandOption
,
CommandOption
,
PutArg
,
PutArg
,
OnConnect
,
}
from
'
koishi-thirdeye
'
;
}
from
'
koishi-thirdeye
'
;
import
{
Game
,
ReportScoreResult
}
from
'
./def/Match
'
;
import
{
Game
,
ReportScoreResult
}
from
'
./def/Match
'
;
import
{
classToPlain
,
plainToClass
}
from
'
class-transformer
'
;
import
{
classToPlain
,
plainToClass
}
from
'
class-transformer
'
;
...
@@ -32,7 +33,7 @@ declare module 'koishi' {
...
@@ -32,7 +33,7 @@ declare module 'koishi' {
}
}
@
KoishiPlugin
({
name
:
'
tabulate
'
,
schema
:
TabulatePluginConfig
})
@
KoishiPlugin
({
name
:
'
tabulate
'
,
schema
:
TabulatePluginConfig
})
export
default
class
TabulatePlugin
implements
OnApply
{
export
default
class
TabulatePlugin
implements
OnApply
,
OnConnect
{
constructor
(
private
ctx
:
Context
,
config
:
TabulatePluginConfigLike
)
{}
constructor
(
private
ctx
:
Context
,
config
:
TabulatePluginConfigLike
)
{}
async
getGames
(
key
:
string
)
{
async
getGames
(
key
:
string
)
{
...
@@ -60,11 +61,10 @@ export default class TabulatePlugin implements OnApply {
...
@@ -60,11 +61,10 @@ export default class TabulatePlugin implements OnApply {
@
InjectConfig
()
@
InjectConfig
()
private
config
:
TabulatePluginConfig
;
private
config
:
TabulatePluginConfig
;
@
Inject
(
'
cache
'
)
@
Inject
(
'
cache
'
,
true
)
private
cache
:
Cache
;
private
cache
:
Cache
;
@
UseEvent
(
'
service/cache
'
)
onConnect
()
{
loadCacheTable
()
{
this
.
cache
.
table
(
'
tabulateMatches
'
,
{
maxAge
:
this
.
config
.
saveTime
});
this
.
cache
.
table
(
'
tabulateMatches
'
,
{
maxAge
:
this
.
config
.
saveTime
});
}
}
...
...
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