File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
examples/with-workflow/src/app/commands Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ import { greetUserWorkflow } from '@/workflows/greet/greet.workflow' ;
2+ import type { CommandData , ChatInputCommand , MessageCommand } from 'commandkit' ;
3+ import { start } from 'workflow/api' ;
4+
5+ export const command : CommandData = {
6+ name : 'greet' ,
7+ description : 'greet command' ,
8+ } ;
9+
10+ export const chatInput : ChatInputCommand = async ( ctx ) => {
11+ await ctx . interaction . reply ( `I'm gonna greet you :wink:` ) ;
12+
13+ await start ( greetUserWorkflow , [ ctx . interaction . user . id ] ) ;
14+ } ;
15+
16+ export const message : MessageCommand = async ( ctx ) => {
17+ await ctx . message . reply ( `I'm gonna greet you :wink:` ) ;
18+
19+ await start ( greetUserWorkflow , [ ctx . message . author . id ] ) ;
20+ } ;
You can’t perform that action at this time.
0 commit comments