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
a5470f96
Commit
a5470f96
authored
Jan 11, 2023
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
subscribe text
parent
a2c8d164
Pipeline
#19409
canceled with stages
in 8 minutes and 16 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
src/command-count/command-count.service.ts
src/command-count/command-count.service.ts
+3
-0
src/on-subscribe/on-subscribe.service.ts
src/on-subscribe/on-subscribe.service.ts
+16
-3
No files found.
src/command-count/command-count.service.ts
View file @
a5470f96
...
...
@@ -14,6 +14,9 @@ export class CommandCountService extends CrudService(CommandCount) {
@
UseEvent
(
'
command/before-execute
'
)
async
onCommand
(
argv
:
Argv
)
{
this
.
log
.
log
(
`User
${
argv
.
session
.
userId
}
executed command
${
argv
.
command
.
name
}
`
,
);
const
record
=
new
CommandCount
().
fromArgv
(
argv
);
await
this
.
create
(
record
);
}
...
...
src/on-subscribe/on-subscribe.service.ts
View file @
a5470f96
import
{
Injectable
}
from
'
@nestjs/common
'
;
import
{
ConsoleLogger
,
Injectable
}
from
'
@nestjs/common
'
;
import
{
UseEvent
}
from
'
koishi-nestjs
'
;
import
{
Session
}
from
'
koishi
'
;
@
Injectable
()
export
class
OnSubscribeService
{
export
class
OnSubscribeService
extends
ConsoleLogger
{
constructor
()
{
super
(
'
OnSubscribeService
'
);
}
@
UseEvent
(
'
wechat:subscribe
'
)
async
onSubscribe
(
session
:
Session
)
{
await
session
.
send
(
'
感谢关注决斗暗网服务号!
'
);
this
.
log
(
`User
${
session
.
userId
}
subscribed.`
);
await
session
.
send
(
'
欢迎关注决斗暗网!
\n
'
+
'
\n
'
+
'
我们的菜单包含了各种功能,其中有游戏下载方式,玩家社区,举报反馈渠道等。
'
,
);
}
@
UseEvent
(
'
wechat:unsubscribe
'
)
async
onUnsubscribe
(
session
:
Session
)
{
this
.
log
(
`User
${
session
.
userId
}
unsubscribed.`
);
}
}
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