Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
update triggers with new types
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-zijdemans-vipps committed Sep 28, 2023
1 parent b826c3c commit bd4e444
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
7 changes: 4 additions & 3 deletions triggers/display_leaderboard_trigger.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import { Trigger } from "deno-slack-sdk/types.ts";
import { TriggerContextData, TriggerTypes } from "deno-slack-api/mod.ts";
import DisplayLeaderboardWorkflow from "../workflows/display_leaderboard_workflow.ts";

const DisplayLeaderboardTrigger: Trigger<
typeof DisplayLeaderboardWorkflow.definition
> = {
type: "shortcut",
type: TriggerTypes.Shortcut,
name: "Display the leaderboard",
description: "Show stats for the team and individual runners",
workflow: `#/workflows/${DisplayLeaderboardWorkflow.definition.callback_id}`,
inputs: {
interactivity: {
value: "{{data.interactivity}}",
value: TriggerContextData.Shortcut.interactivity,
},
channel: {
value: "{{data.channel_id}}",
value: TriggerContextData.Shortcut.channel_id,
},
},
};
Expand Down
7 changes: 4 additions & 3 deletions triggers/display_weekly_stats.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import { Trigger } from "deno-slack-sdk/types.ts";
import { TriggerContextData, TriggerTypes } from "deno-slack-api/mod.ts";
import DisplayLeaderboardWorkflow from "../workflows/display_leaderboard_workflow.ts";

const DisplayWeeklyStats: Trigger<
typeof DisplayLeaderboardWorkflow.definition
> = {
type: "scheduled",
type: TriggerTypes.Scheduled,
name: "Display weekly stats",
description: "Display weekly running stats on a schedule",
workflow: `#/workflows/${DisplayLeaderboardWorkflow.definition.callback_id}`,
inputs: {
interactivity: {
value: "{{data.interactivity}}",
value: TriggerContextData.Shortcut.interactivity,
},
channel: {
value: "{{data.channel_id}}",
value: TriggerContextData.Shortcut.channel_id,
},
},
schedule: {
Expand Down
9 changes: 5 additions & 4 deletions triggers/log_run_trigger.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import { Trigger } from "deno-slack-sdk/types.ts";
import { TriggerContextData, TriggerTypes } from "deno-slack-api/mod.ts";
import LogRunWorkflow from "../workflows/log_run_workflow.ts";

const LogRunTrigger: Trigger<typeof LogRunWorkflow.definition> = {
type: "shortcut",
type: TriggerTypes.Shortcut,
name: "Log a run",
description: "Save the details of a recent run",
workflow: `#/workflows/${LogRunWorkflow.definition.callback_id}`,
inputs: {
interactivity: {
value: "{{data.interactivity}}",
value: TriggerContextData.Shortcut.interactivity,
},
channel: {
value: "{{data.channel_id}}",
value: TriggerContextData.Shortcut.channel_id,
},
user_id: {
value: "{{data.user_id}}",
value: TriggerContextData.Shortcut.user_id,
},
},
};
Expand Down

0 comments on commit bd4e444

Please sign in to comment.