Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
Jdaw
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
MyCard
Jdaw
Commits
a2c8d164
Commit
a2c8d164
authored
Jan 11, 2023
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
send on subscribe
parent
5977f881
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
6 deletions
+37
-6
src/app.module.ts
src/app.module.ts
+3
-1
src/feedback/feedback.service.ts
src/feedback/feedback.service.ts
+5
-0
src/on-subscribe/on-subscribe.service.spec.ts
src/on-subscribe/on-subscribe.service.spec.ts
+18
-0
src/on-subscribe/on-subscribe.service.ts
src/on-subscribe/on-subscribe.service.ts
+11
-0
src/reply/reply.service.ts
src/reply/reply.service.ts
+0
-5
No files found.
src/app.module.ts
View file @
a2c8d164
...
...
@@ -14,6 +14,7 @@ import { FeedbackService } from './feedback/feedback.service';
import
PuppeteerPlugin
from
'
koishi-plugin-puppeteer
'
;
import
{
HttpModule
}
from
'
@nestjs/axios
'
;
import
{
Feedback
}
from
'
./feedback/entities/feedback.entity
'
;
import
{
OnSubscribeService
}
from
'
./on-subscribe/on-subscribe.service
'
;
@
Module
({
imports
:
[
...
...
@@ -126,7 +127,7 @@ import { Feedback } from './feedback/entities/feedback.entity';
{
type
:
'
click
'
,
name
:
'
有奖调研
'
,
command
:
'
reply.bonus
'
,
command
:
'
invenstigate
'
,
},
{
type
:
'
click
'
,
...
...
@@ -151,6 +152,7 @@ import { Feedback } from './feedback/entities/feedback.entity';
CommandCountService
,
CdbLoaderService
,
FeedbackService
,
OnSubscribeService
,
],
})
export
class
AppModule
{}
src/feedback/feedback.service.ts
View file @
a2c8d164
...
...
@@ -71,6 +71,11 @@ export class FeedbackService extends CrudService(Feedback) {
}
}
@
UseCommand
(
'
investigate
'
,
'
调研
'
)
private
async
investigateCommand
()
{
return
'
欢迎访问MC有奖调研功能。目前暂时无进行中的调研。我们一般每1-2个月都会公布有奖调研,欢迎下次再查询。
'
;
}
@
UseCommand
(
'
feedback
'
,
'
发送反馈。
'
)
private
async
feedbackCommand
(@
PutSession
()
session
:
Session
)
{
await
session
.
send
(
...
...
src/on-subscribe/on-subscribe.service.spec.ts
0 → 100644
View file @
a2c8d164
import
{
Test
,
TestingModule
}
from
'
@nestjs/testing
'
;
import
{
OnSubscribeService
}
from
'
./on-subscribe.service
'
;
describe
(
'
OnSubscribeService
'
,
()
=>
{
let
service
:
OnSubscribeService
;
beforeEach
(
async
()
=>
{
const
module
:
TestingModule
=
await
Test
.
createTestingModule
({
providers
:
[
OnSubscribeService
],
}).
compile
();
service
=
module
.
get
<
OnSubscribeService
>
(
OnSubscribeService
);
});
it
(
'
should be defined
'
,
()
=>
{
expect
(
service
).
toBeDefined
();
});
});
src/on-subscribe/on-subscribe.service.ts
0 → 100644
View file @
a2c8d164
import
{
Injectable
}
from
'
@nestjs/common
'
;
import
{
UseEvent
}
from
'
koishi-nestjs
'
;
import
{
Session
}
from
'
koishi
'
;
@
Injectable
()
export
class
OnSubscribeService
{
@
UseEvent
(
'
wechat:subscribe
'
)
async
onSubscribe
(
session
:
Session
)
{
await
session
.
send
(
'
感谢关注决斗暗网服务号!
'
);
}
}
src/reply/reply.service.ts
View file @
a2c8d164
...
...
@@ -50,11 +50,6 @@ export class ReplyService implements OnModuleInit {
'
现在为广大玩家们提供娘化补丁下载。
\n
'
+
'
详情与下载方式:https://ygobbs.com/t/396440
'
,
},
{
key
:
'
bonus
'
,
content
:
'
欢迎访问MC有奖调研功能。目前暂时无进行中的调研。我们一般每1-2个月都会公布有奖调研,欢迎下次再查询。
'
,
},
];
constructor
(@
InjectContext
()
private
ctx
:
Context
)
{}
...
...
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