Skip to content

Commit 392b9d8

Browse files
committed
fix: example template for workflow
1 parent 593c695 commit 392b9d8

File tree

1 file changed

+20
-0
lines changed
  • examples/with-workflow/src/app/commands

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
};

0 commit comments

Comments
 (0)