Example Job that has an unconfigured Integration (for testing)

This commit is contained in:
Matt Aitken
2023-07-06 11:56:01 +01:00
parent 3e9b440322
commit be6741a4a8
+21
View File
@@ -12,6 +12,7 @@ const db = {
};
export const slack = new Slack({ id: "slack-6" });
export const slackMissing = new Slack({ id: "slack-7" });
new Job(client, {
id: "slack-kpi-summary",
@@ -69,3 +70,23 @@ new Job(client, {
return response;
},
});
new Job(client, {
id: "slack-missing-integration",
name: "Slack with missing integration",
version: "0.1.1",
integrations: {
slack: slackMissing,
},
trigger: eventTrigger({
name: "missing.integration",
}),
run: async (payload, io, ctx) => {
const response = await io.slack.postMessage("message", {
text: `There's no Slack connection, or is there?`,
channel: "C04GWUTDC3W",
});
return response;
},
});