diff --git a/import_map.json b/import_map.json index df0a5d4..c21fa4c 100644 --- a/import_map.json +++ b/import_map.json @@ -1,7 +1,7 @@ { "imports": { - "deno-slack-sdk/": "https://deno.land/x/deno_slack_sdk@2.2.0/", - "deno-slack-api/": "https://deno.land/x/deno_slack_api@2.1.1/", + "deno-slack-sdk/": "https://deno.land/x/deno_slack_sdk@2.3.0/", + "deno-slack-api/": "https://deno.land/x/deno_slack_api@2.1.2/", "std/": "https://deno.land/std@0.183.0/", "mock-fetch/": "https://deno.land/x/mock_fetch@0.3.0/" } diff --git a/triggers/display_leaderboard_trigger.ts b/triggers/display_leaderboard_trigger.ts index 37a51b7..4f949b1 100644 --- a/triggers/display_leaderboard_trigger.ts +++ b/triggers/display_leaderboard_trigger.ts @@ -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, }, }, }; diff --git a/triggers/display_weekly_stats.ts b/triggers/display_weekly_stats.ts index c0c6e43..920698e 100644 --- a/triggers/display_weekly_stats.ts +++ b/triggers/display_weekly_stats.ts @@ -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: { diff --git a/triggers/log_run_trigger.ts b/triggers/log_run_trigger.ts index c1ea410..a1ae153 100644 --- a/triggers/log_run_trigger.ts +++ b/triggers/log_run_trigger.ts @@ -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 = { - 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, }, }, };