-
Notifications
You must be signed in to change notification settings - Fork 19
/
sample_trigger.ts
28 lines (27 loc) · 940 Bytes
/
sample_trigger.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { Trigger } from "deno-slack-sdk/types.ts";
import { TriggerContextData, TriggerTypes } from "deno-slack-api/mod.ts";
import SampleWorkflow from "../workflows/sample_workflow.ts";
/**
* Triggers determine when workflows are executed. A trigger
* file describes a scenario in which a workflow should be run,
* such as a user pressing a button or when a specific event occurs.
* https://api.slack.com/automation/triggers
*/
const sampleTrigger: Trigger<typeof SampleWorkflow.definition> = {
type: TriggerTypes.Shortcut,
name: "Sample trigger",
description: "A sample trigger",
workflow: `#/workflows/${SampleWorkflow.definition.callback_id}`,
inputs: {
interactivity: {
value: TriggerContextData.Shortcut.interactivity,
},
channel: {
value: TriggerContextData.Shortcut.channel_id,
},
user: {
value: TriggerContextData.Shortcut.user_id,
},
},
};
export default sampleTrigger;