Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
koishi-plugin-hisoutensoku-jammer
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
nanahira
koishi-plugin-hisoutensoku-jammer
Commits
803fb563
Commit
803fb563
authored
Dec 04, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
catchup
parent
f0e851f6
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
89 deletions
+74
-89
package-lock.json
package-lock.json
+61
-76
package.json
package.json
+3
-3
src/config.ts
src/config.ts
+6
-6
src/index.ts
src/index.ts
+4
-4
No files found.
package-lock.json
View file @
803fb563
This diff is collapsed.
Click to expand it.
package.json
View file @
803fb563
...
@@ -24,11 +24,11 @@
...
@@ -24,11 +24,11 @@
},
},
"homepage"
:
"
https://code.mycard.moe/nanahira/koishi-plugin-hisoutensoku-jammer
"
,
"homepage"
:
"
https://code.mycard.moe/nanahira/koishi-plugin-hisoutensoku-jammer
"
,
"peerDependencies"
:
{
"peerDependencies"
:
{
"
koishi
"
:
"
^4.0.0-beta.
3
"
"
koishi
"
:
"
^4.0.0-beta.
4
"
},
},
"dependencies"
:
{
"dependencies"
:
{
"
ip
"
:
"
^1.1.5
"
,
"
ip
"
:
"
^1.1.5
"
,
"
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.21
"
,
"
source-map-support
"
:
"
^0.5.21
"
,
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,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 @
803fb563
...
@@ -7,22 +7,22 @@ import path from 'path';
...
@@ -7,22 +7,22 @@ import path from 'path';
@
RegisterSchema
()
@
RegisterSchema
()
export
class
HisoutensokuJammerPluginConfig
{
export
class
HisoutensokuJammerPluginConfig
{
@
DefineSchema
({
desc
:
'
干扰时间
'
,
default
:
10000
})
@
DefineSchema
({
desc
ription
:
'
干扰时间
'
,
default
:
10000
})
attackTimeout
:
number
;
attackTimeout
:
number
;
@
DefineSchema
({
desc
:
'
IP 白名单
'
,
default
:
[],
type
:
'
string
'
})
@
DefineSchema
({
desc
ription
:
'
IP 白名单
'
,
default
:
[],
type
:
'
string
'
})
addressWhitelist
:
string
[];
addressWhitelist
:
string
[];
@
DefineSchema
({
desc
:
'
开启文字识别
'
,
default
:
false
})
@
DefineSchema
({
desc
ription
:
'
开启文字识别
'
,
default
:
false
})
ocr
:
boolean
;
ocr
:
boolean
;
@
DefineSchema
({
desc
:
'
模型语言
'
,
default
:
'
eng
'
})
@
DefineSchema
({
desc
ription
:
'
模型语言
'
,
default
:
'
eng
'
})
ocrLanguage
:
string
;
ocrLanguage
:
string
;
@
DefineSchema
({
type
:
'
object
'
,
allowUnknown
:
true
})
@
DefineSchema
({
type
:
'
object
'
})
ocrExtraOptions
:
Partial
<
Tesseract
.
WorkerOptions
>
;
ocrExtraOptions
:
Partial
<
Tesseract
.
WorkerOptions
>
;
@
DefineSchema
({
type
:
'
object
'
,
allowUnknown
:
true
})
@
DefineSchema
({
type
:
'
object
'
})
ocrExtraParameters
:
Partial
<
Tesseract
.
WorkerParams
>
;
ocrExtraParameters
:
Partial
<
Tesseract
.
WorkerParams
>
;
async
loadOcr
()
{
async
loadOcr
()
{
...
...
src/index.ts
View file @
803fb563
...
@@ -11,6 +11,7 @@ import {
...
@@ -11,6 +11,7 @@ import {
InjectLogger
,
InjectLogger
,
Inject
,
Inject
,
UseEvent
,
UseEvent
,
OnConnect
,
}
from
'
koishi-thirdeye
'
;
}
from
'
koishi-thirdeye
'
;
import
{
Attacker
}
from
'
./attacker
'
;
import
{
Attacker
}
from
'
./attacker
'
;
import
moment
from
'
moment
'
;
import
moment
from
'
moment
'
;
...
@@ -38,7 +39,7 @@ const PROTOCOL_BASE64 = 'base64://';
...
@@ -38,7 +39,7 @@ const PROTOCOL_BASE64 = 'base64://';
name
:
'
hisoutensoku-jammer
'
,
name
:
'
hisoutensoku-jammer
'
,
schema
:
HisoutensokuJammerPluginConfig
,
schema
:
HisoutensokuJammerPluginConfig
,
})
})
export
default
class
HisoutensokuJammerPlugin
{
export
default
class
HisoutensokuJammerPlugin
implements
OnConnect
{
constructor
(
constructor
(
private
ctx
:
Context
,
private
ctx
:
Context
,
config
:
HisoutensokuJammerPluginConfigLike
,
config
:
HisoutensokuJammerPluginConfigLike
,
...
@@ -47,11 +48,10 @@ export default class HisoutensokuJammerPlugin {
...
@@ -47,11 +48,10 @@ export default class HisoutensokuJammerPlugin {
@
InjectLogger
()
@
InjectLogger
()
private
log
:
Logger
;
private
log
:
Logger
;
@
Inject
(
'
cache
'
)
@
Inject
(
'
cache
'
,
true
)
private
cache
:
Cache
;
private
cache
:
Cache
;
@
UseEvent
(
'
service/cache
'
)
onConnect
()
{
initializeCacheTable
()
{
this
.
cache
.
table
(
'
lastMessages
'
,
{
maxAge
:
600000
});
this
.
cache
.
table
(
'
lastMessages
'
,
{
maxAge
:
600000
});
}
}
...
...
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