Skip to content

Commit

Permalink
feat(teach): support notify event hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Oct 15, 2020
1 parent 16cc3ee commit 953591c
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions packages/plugin-teach/src/receiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,17 @@ export default function (ctx: Context, config: Dialogue.Config) {
}

ctx.group().middleware(async (session, next) => {
return session.$execute({
command: 'dialogue',
args: [session.message],
next,
})
return triggerDialogue(ctx, session, next)
})

ctx.on('notify/poke', (session) => {
session.message = 'hook:poke'
triggerDialogue(ctx, session)
})

ctx.on('notify/honor', (session) => {
session.message = 'hook:' + session.honorType
triggerDialogue(ctx, session)
})

ctx.on('dialogue/receive', ({ session, test }) => {
Expand Down

0 comments on commit 953591c

Please sign in to comment.