Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
H
hisoutensoku-terminator
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
hisoutensoku-terminator
Commits
d136d7ca
Commit
d136d7ca
authored
Jun 18, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes
parent
d3184f33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
README.md
README.md
+0
-2
run.ts
run.ts
+14
-4
No files found.
README.md
View file @
d136d7ca
...
...
@@ -19,8 +19,6 @@ This project may possibly be working only with Hisoutensoku ver 1.10a. Versions
*
Create a
`config.yaml`
with the following below.
```
yaml
address
:
0.0.0.0
# CoolQ listen address and port. Leave it.
port
:
80
coolq
:
# CoolQ config. The docker-compose config below meets this configuration.
host
:
coolq
accessToken
:
aaaaa
...
...
run.ts
View file @
d136d7ca
import
bunyan
from
"
bunyan
"
;
import
fs
from
"
fs
"
;
import
{
CQWebSocket
}
from
"
cq-websocket
"
;
import
{
CQWebSocket
,
CQEvent
,
CQTag
}
from
"
cq-websocket
"
;
import
_
from
"
underscore
"
;
import
yaml
from
"
yaml
"
;
import
{
spawn
}
from
"
child_process
"
;
...
...
@@ -20,7 +20,7 @@ interface Config {
coolq
:
CoolQConfig
;
floodQQGroups
:
Array
<
number
>
;
attackTimeout
:
number
;
addressWhitelist
:
string
[]
addressWhitelist
:
string
[]
;
}
const
log
=
bunyan
.
createLogger
({
...
...
@@ -60,7 +60,7 @@ async function startAttack(address: string, port: number): Promise<boolean> {
return
true
;
}
async
function
messageHandler
(
data
:
any
):
Promise
<
void
>
{
async
function
messageHandler
(
event
:
CQEvent
,
data
:
any
,
tags
:
CQTag
[]
):
Promise
<
void
>
{
const
groupID
:
number
=
data
.
group_id
;
if
(
!
groupID
||
!
_
.
contains
(
config
.
floodQQGroups
,
groupID
))
{
return
;
...
...
@@ -83,7 +83,17 @@ async function main(): Promise<void> {
CoolQ
=
new
CQWebSocket
(
config
.
coolq
);
CoolQ
.
on
(
"
ready
"
,
async
()
=>
{
log
.
info
(
"
bot init finished.
"
);
})
});
CoolQ
.
on
(
"
error
"
,
async
(
err
)
=>
{
log
.
warn
(
"
bot error
"
,
err
.
toString
());
});
CoolQ
.
on
(
"
socket.error
"
,
async
(
err
)
=>
{
log
.
warn
(
"
bot socket error
"
,
err
.
toString
());
});
CoolQ
.
on
(
"
socket.close
"
,
async
(
err
)
=>
{
log
.
warn
(
"
bot socket close
"
,
err
.
toString
());
});
CoolQ
.
on
(
"
message
"
,
messageHandler
);
CoolQ
.
connect
();
}
main
();
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