@pipedream/slack 0.4.9 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/actions/add-star/add-star.mjs +1 -1
- package/actions/archive-channel/archive-channel.mjs +1 -1
- package/actions/complete-reminder/complete-reminder.mjs +1 -1
- package/actions/create-channel/create-channel.mjs +1 -1
- package/actions/create-reminder/create-reminder.mjs +1 -1
- package/actions/delete-file/delete-file.mjs +1 -1
- package/actions/delete-message/delete-message.mjs +1 -1
- package/actions/{delete_reminder → delete-reminder}/delete-reminder.mjs +1 -1
- package/actions/find-message/find-message.mjs +1 -1
- package/actions/find-user-by-email/find-user-by-email.mjs +1 -1
- package/actions/get-channel/get-channel.mjs +1 -1
- package/actions/get-file/get-file.mjs +1 -1
- package/actions/get-reminder/get-reminder.mjs +1 -1
- package/actions/invite-user-to-channel/invite-user-to-channel.mjs +1 -1
- package/actions/join-channel/join-channel.mjs +1 -1
- package/actions/kick-user/kick-user.mjs +1 -1
- package/actions/leave-channel/leave-channel.mjs +1 -1
- package/actions/list-channels/list-channels.mjs +1 -1
- package/actions/list-files/list-files.mjs +1 -1
- package/actions/list-members-in-channel/list-members-in-channel.mjs +1 -1
- package/actions/list-reminders/list-reminders.mjs +1 -1
- package/actions/list-replies/list-replies.mjs +1 -1
- package/actions/list-user-groups-users/list-user-groups-users.mjs +36 -0
- package/actions/list-users/list-users.mjs +1 -1
- package/actions/remove-star/remove-star.mjs +1 -1
- package/actions/reply-to-a-message/reply-to-a-message.mjs +1 -1
- package/actions/send-block-kit-message/send-block-kit-message.mjs +1 -1
- package/actions/send-custom-message/send-custom-message.mjs +1 -1
- package/actions/send-direct-message/send-direct-message.mjs +1 -1
- package/actions/send-group-message/send-group-message.mjs +1 -1
- package/actions/send-large-message/send-large-message.mjs +1 -1
- package/actions/send-message-private-channel/send-message-private-channel.mjs +1 -1
- package/actions/send-message-public-channel/send-message-public-channel.mjs +1 -1
- package/actions/set-channel-purpose/set-channel-purpose.mjs +1 -1
- package/actions/set-channel-topic/set-channel-topic.mjs +1 -1
- package/actions/unarchive-channel/unarchive-channel.mjs +1 -1
- package/actions/update-message/update-message.mjs +1 -1
- package/actions/update-profile/update-profile.mjs +1 -1
- package/actions/update-user-groups-users/update-user-groups-users.mjs +45 -0
- package/actions/upload-file/upload-file.mjs +1 -1
- package/actions/verify-slack-signature/verify-slack-signature.mjs +60 -0
- package/package.json +1 -1
- package/slack.app.mjs +40 -0
- package/sources/new-direct-message/new-direct-message.mjs +1 -1
- package/sources/new-interaction-event-received/README.md +83 -0
- package/sources/new-interaction-event-received/new-interaction-event-received.mjs +1 -1
- package/sources/new-mention/new-mention.mjs +1 -1
- package/sources/new-message-in-channels/new-message-in-channels.mjs +1 -1
- package/sources/new-reaction-added/new-reaction-added.mjs +1 -1
- package/sources/new-star-added/new-star-added.mjs +1 -1
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-add-star",
|
|
5
5
|
name: "Add Star",
|
|
6
6
|
description: "Add a star to an item on behalf of the authenticated user. [See docs here](https://api.slack.com/methods/stars.add)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.8",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-find-user-by-email",
|
|
5
5
|
name: "Find User by Email",
|
|
6
6
|
description: "Find a user by matching against their email. [See docs here](https://api.slack.com/methods/users.lookupByEmail)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.8",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-get-channel",
|
|
5
5
|
name: "Get Channel",
|
|
6
6
|
description: "Return information about a workspace channel. [See docs here](https://api.slack.com/methods/conversations.info)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.8",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-invite-user-to-channel",
|
|
5
5
|
name: "Invite User to Channel",
|
|
6
6
|
description: "Invite a user to an existing channel. [See docs here](https://api.slack.com/methods/conversations.invite)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.8",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-list-channels",
|
|
5
5
|
name: "List Channels",
|
|
6
6
|
description: "Return a list of all channels in a workspace. [See docs here](https://api.slack.com/methods/conversations.list)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.8",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-list-members-in-channel",
|
|
5
5
|
name: "List Members in Channel",
|
|
6
6
|
description: "Retrieve members of a channel. [See docs here](https://api.slack.com/methods/conversations.members)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.8",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-list-reminders",
|
|
5
5
|
name: "List Reminders",
|
|
6
6
|
description: "List all reminders for a given user. [See docs here](https://api.slack.com/methods/reminders.list)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.8",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-list-replies",
|
|
5
5
|
name: "List Replies",
|
|
6
6
|
description: "Retrieve a thread of messages posted to a conversation. [See docs here](https://api.slack.com/methods/conversations.replies)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.8",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import slack from "../../slack.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "slack-list-user-groups-users",
|
|
5
|
+
name: "List User Groups Users",
|
|
6
|
+
description: "List all users in a User Group. [See docs here](https://api.slack.com/methods/usergroups.users.list)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
slack,
|
|
11
|
+
userGroup: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
slack,
|
|
14
|
+
"userGroup",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
team: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
slack,
|
|
20
|
+
"team",
|
|
21
|
+
],
|
|
22
|
+
optional: true,
|
|
23
|
+
description: "Encoded team id where the user group exists, required if org token is used.",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
async run() {
|
|
27
|
+
const {
|
|
28
|
+
userGroup,
|
|
29
|
+
team,
|
|
30
|
+
} = this;
|
|
31
|
+
return await this.slack.sdk().usergroups.users.list({
|
|
32
|
+
usergroup: userGroup,
|
|
33
|
+
team_id: team,
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-remove-star",
|
|
5
5
|
name: "Remove Star",
|
|
6
6
|
description: "Remove a star from an item on behalf of the authenticated user. [See docs here](https://api.slack.com/methods/stars.remove)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.8",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "slack-reply-to-a-message",
|
|
7
7
|
name: "Reply to a Message Thread",
|
|
8
8
|
description: "Send a message as a threaded reply. See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.11",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
...common.props,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack-send-block-kit-message",
|
|
6
6
|
name: "Send Message Using Block Kit",
|
|
7
7
|
description: "Send a message using Slack's Block Kit UI framework to a channel, group or user. See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
|
|
8
|
-
version: "0.2.
|
|
8
|
+
version: "0.2.10",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack-send-custom-message",
|
|
6
6
|
name: "Send a Custom Message",
|
|
7
7
|
description: "Customize advanced setttings and send a message to a channel, group or user. See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
|
|
8
|
-
version: "0.2.
|
|
8
|
+
version: "0.2.10",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack-send-direct-message",
|
|
6
6
|
name: "Send a Direct Message",
|
|
7
7
|
description: "Send a direct message to a single user. See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
|
|
8
|
-
version: "0.2.
|
|
8
|
+
version: "0.2.11",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack-send-group-message",
|
|
6
6
|
name: "Send Group Message",
|
|
7
7
|
description: "Send a direct message to a group of users. See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
|
|
8
|
-
version: "0.2.
|
|
8
|
+
version: "0.2.11",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack-send-large-message",
|
|
6
6
|
name: "Send a Large Message (3000+ characters)",
|
|
7
7
|
description: "Send a large message (more than 3000 characters) to a channel, group or user. See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.6",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack-send-message-private-channel",
|
|
6
6
|
name: "Send Message to a Private Channel",
|
|
7
7
|
description: "Send a message to a private channel and customize the name and avatar of the bot that posts the message. See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
|
|
8
|
-
version: "0.2.
|
|
8
|
+
version: "0.2.11",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack-send-message-public-channel",
|
|
6
6
|
name: "Send Message to a Public Channel",
|
|
7
7
|
description: "Send a message to a public channel and customize the name and avatar of the bot that posts the message. See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
|
|
8
|
-
version: "0.2.
|
|
8
|
+
version: "0.2.10",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-set-channel-purpose",
|
|
5
5
|
name: "Set Channel Purpose",
|
|
6
6
|
description: "Change the purpose of a channel. [See docs here](https://api.slack.com/methods/conversations.setPurpose)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.9",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-set-channel-topic",
|
|
5
5
|
name: "Set Channel Topic",
|
|
6
6
|
description: "Set the topic on a selected channel. [See docs here](https://api.slack.com/methods/conversations.setTopic)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.8",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-unarchive-channel",
|
|
5
5
|
name: "Unarchive Channel",
|
|
6
6
|
description: "Unarchive a channel. [See docs here](https://api.slack.com/methods/conversations.unarchive)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.8",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-update-profile",
|
|
5
5
|
name: "Update Profile",
|
|
6
6
|
description: "Update basic profile field such as name or title. [See docs here](https://api.slack.com/methods/users.profile.set)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.8",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import slack from "../../slack.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "slack-update-user-groups-users",
|
|
5
|
+
name: "Update User Groups Users",
|
|
6
|
+
description: "Update the list of users for a User Group. [See docs here](https://api.slack.com/methods/usergroups.users.update)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
slack,
|
|
11
|
+
userGroup: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
slack,
|
|
14
|
+
"userGroup",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
users: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
slack,
|
|
20
|
+
"users",
|
|
21
|
+
],
|
|
22
|
+
description: "A list of encoded user IDs that represent the entire list of users for the User Group.",
|
|
23
|
+
},
|
|
24
|
+
team: {
|
|
25
|
+
propDefinition: [
|
|
26
|
+
slack,
|
|
27
|
+
"team",
|
|
28
|
+
],
|
|
29
|
+
optional: true,
|
|
30
|
+
description: "Encoded team id where the user group exists, required if org token is used.",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
async run() {
|
|
34
|
+
const {
|
|
35
|
+
userGroup,
|
|
36
|
+
users,
|
|
37
|
+
team,
|
|
38
|
+
} = this;
|
|
39
|
+
return await this.slack.sdk().usergroups.users.update({
|
|
40
|
+
usergroup: userGroup,
|
|
41
|
+
users: users,
|
|
42
|
+
team_id: team,
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import slack from "../../slack.app.mjs";
|
|
2
|
+
import crypto from "crypto";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "slack-verify-slack-signature",
|
|
6
|
+
name: "Verify Slack Signature",
|
|
7
|
+
description: "Verifying requests from Slack, slack signs its requests using a secret that's unique to your app. [See docs here](https://api.slack.com/authentication/verifying-requests-from-slack)",
|
|
8
|
+
version: "0.0.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
slack,
|
|
12
|
+
slackSigningSecret: {
|
|
13
|
+
type: "string",
|
|
14
|
+
label: "Signing Secret",
|
|
15
|
+
description: "Slack [Signing Secret](https://api.slack.com/authentication/verifying-requests-from-slack#:~:text=Slack%20Signing%20Secret%2C%20available%20in%20the%20app%20admin%20panel%20under%20Basic%20Info.), available in the app admin panel under Basic Info.",
|
|
16
|
+
secret: true,
|
|
17
|
+
},
|
|
18
|
+
slackSignature: {
|
|
19
|
+
type: "string",
|
|
20
|
+
label: "X-Slack-Signature",
|
|
21
|
+
description: "Slack signature (from X-Slack-Signature header).",
|
|
22
|
+
},
|
|
23
|
+
slackRequestTimestamp: {
|
|
24
|
+
type: "string",
|
|
25
|
+
label: "X-Slack-Request-Timestamp",
|
|
26
|
+
description: "Slack request timestamp (from X-Slack-Request-Timestamp header).",
|
|
27
|
+
},
|
|
28
|
+
requestBody: {
|
|
29
|
+
type: "any",
|
|
30
|
+
label: "Request Body",
|
|
31
|
+
description: "The body of the request to be verified.",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
async run({ $ }) {
|
|
35
|
+
const {
|
|
36
|
+
slackSignature,
|
|
37
|
+
slackRequestTimestamp,
|
|
38
|
+
requestBody,
|
|
39
|
+
slackSigningSecret,
|
|
40
|
+
} = this;
|
|
41
|
+
const requestBodyStr = typeof (requestBody) === "string" ?
|
|
42
|
+
requestBody :
|
|
43
|
+
JSON.stringify(requestBody);
|
|
44
|
+
const sigBaseString = `v0:${slackRequestTimestamp}:${requestBodyStr}`;
|
|
45
|
+
const sha256Hex = crypto.createHmac("sha256", slackSigningSecret)
|
|
46
|
+
.update(sigBaseString, "utf8")
|
|
47
|
+
.digest("hex");
|
|
48
|
+
const mySignature = `v0=${sha256Hex}`;
|
|
49
|
+
if (crypto.timingSafeEqual(Buffer.from(mySignature, "utf8"), Buffer.from(slackSignature, "utf8"))) {
|
|
50
|
+
$.export("$summary", `Successfully verified the request with "${slackSignature}" signature`);
|
|
51
|
+
return {
|
|
52
|
+
success: true,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
$.export("$summary", "Slack signature mismatch with provided properties, it may be a configuration issue.");
|
|
56
|
+
return {
|
|
57
|
+
success: false,
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
};
|
package/package.json
CHANGED
package/slack.app.mjs
CHANGED
|
@@ -96,6 +96,34 @@ export default {
|
|
|
96
96
|
};
|
|
97
97
|
},
|
|
98
98
|
},
|
|
99
|
+
users: {
|
|
100
|
+
type: "string[]",
|
|
101
|
+
label: "Users",
|
|
102
|
+
description: "Select users",
|
|
103
|
+
async options() {
|
|
104
|
+
const userNames = await this.userNames();
|
|
105
|
+
const users = [];
|
|
106
|
+
for (const key of Object.keys(userNames)) {
|
|
107
|
+
users.push({
|
|
108
|
+
label: userNames[key],
|
|
109
|
+
value: key,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
return users;
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
userGroup: {
|
|
116
|
+
type: "string",
|
|
117
|
+
label: "User Group",
|
|
118
|
+
description: "The encoded ID of the User Group.",
|
|
119
|
+
async options() {
|
|
120
|
+
const resp = await this.userGroups();
|
|
121
|
+
return resp.map((c) => ({
|
|
122
|
+
label: c.name,
|
|
123
|
+
value: c.id,
|
|
124
|
+
}));
|
|
125
|
+
},
|
|
126
|
+
},
|
|
99
127
|
reminder: {
|
|
100
128
|
type: "string",
|
|
101
129
|
label: "Reminder",
|
|
@@ -505,6 +533,18 @@ export default {
|
|
|
505
533
|
throw (resp.error);
|
|
506
534
|
}
|
|
507
535
|
},
|
|
536
|
+
/**
|
|
537
|
+
* Returns a list of all users groups in the workspace.
|
|
538
|
+
*/
|
|
539
|
+
async userGroups() {
|
|
540
|
+
const resp = await this.sdk().usergroups.list();
|
|
541
|
+
if (resp.ok) {
|
|
542
|
+
return resp.usergroups;
|
|
543
|
+
} else {
|
|
544
|
+
console.log("Error getting user groups", resp.error);
|
|
545
|
+
throw (resp.error);
|
|
546
|
+
}
|
|
547
|
+
},
|
|
508
548
|
/**
|
|
509
549
|
* Returns a mapping from user ID to user name for all users in the workspace
|
|
510
550
|
*
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
...common,
|
|
5
5
|
key: "slack-new-direct-message",
|
|
6
6
|
name: "New Direct Message (Instant)",
|
|
7
|
-
version: "1.0.
|
|
7
|
+
version: "1.0.5",
|
|
8
8
|
description: "Emit new event when a message was posted in a direct message channel",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
Slack messages can contain interactive elements like buttons, dropdowns, radio buttons, and more. This source subscribes to interactive events, like when a button is clicked in a message.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
Then this source will be triggered when you or another Slack user in your workspace clicks a button, selects an option or fills out a form.
|
|
8
|
+
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
With this trigger, you can build workflows that perform some work with other APIs or services, and then reply back to the original message.
|
|
12
|
+
|
|
13
|
+
# Getting Started
|
|
14
|
+
|
|
15
|
+
<iframe width="560" height="315" src="https://www.youtube.com/embed/RZ3XQENkjeg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
|
16
|
+
|
|
17
|
+
What this short video to learn how to use this in a workflow, or follow the guide below.
|
|
18
|
+
|
|
19
|
+
First, if you haven’t already - send yourself a message containing one or more interactive elements. Use the ******************Sending the message with an interactive element****************** guide below to send a messsage containing a button.
|
|
20
|
+
|
|
21
|
+
If you have already sent a message containing an element, skip to **********************************************Configuring the source.**********************************************
|
|
22
|
+
|
|
23
|
+
## Sending the message with an interactive element
|
|
24
|
+
|
|
25
|
+
The easiest way is to send yourself a message using the ****************************Slack - Send Message Using Block Kit**************************** action:
|
|
26
|
+
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
Then select a **************Channel************** you’d like to send the message to, and use the **************[Block Kit Builder](https://app.slack.com/block-kit-builder/)************** to build a message, or just copy the example button blocks below:
|
|
30
|
+
|
|
31
|
+
```jsx
|
|
32
|
+
[
|
|
33
|
+
{
|
|
34
|
+
type: "actions",
|
|
35
|
+
elements: [
|
|
36
|
+
{
|
|
37
|
+
type: "button",
|
|
38
|
+
text: {
|
|
39
|
+
type: "plain_text",
|
|
40
|
+
text: "Click Me",
|
|
41
|
+
emoji: true,
|
|
42
|
+
},
|
|
43
|
+
value: "click_me_123",
|
|
44
|
+
action_id: "button_click",
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Your ******************Slack - Send Message Using Block Kit****************** should look like this:
|
|
52
|
+
|
|
53
|
+

|
|
54
|
+
|
|
55
|
+
## Configuring the source
|
|
56
|
+
|
|
57
|
+
By default, this source will listen to ******all****** interactive events from your Slack workspace that your connected Slack account has authorization to view.
|
|
58
|
+
|
|
59
|
+
You can filter these events by selecting a specific **************channel************** and/or a specific **********action_id.**********
|
|
60
|
+
|
|
61
|
+
### Filtering interactive events by channel
|
|
62
|
+
|
|
63
|
+
Use the ****************Channels**************** dropdown to search for a specific channel for this source to subscribe to. ********Only******** button clicks, dropdown selects, etc. *in this selected channel* will trigger the source.
|
|
64
|
+
|
|
65
|
+
### Filtering interactive events by `action_id`
|
|
66
|
+
|
|
67
|
+
For more specificity, you can filter based on the passed `action_id` to the message.
|
|
68
|
+
|
|
69
|
+
The `action_id` is arbitrary. It’s defined on the initial message sending the button, dropdown, or other interactive element’s markup.
|
|
70
|
+
|
|
71
|
+
For example, in the section above using the Block Kit to create a message, we defined the button’s `action_id` as `"button_click"`. But you can choose whichever naming convention you’d like.
|
|
72
|
+
|
|
73
|
+
If you pass `button_click` as a required `action_id` to this source, then only interactivity events with the `action_id` of `"button_click"` will trigger this source.
|
|
74
|
+
|
|
75
|
+
# Troubleshooting
|
|
76
|
+
|
|
77
|
+
## I’m clicking buttons, but no events are being received
|
|
78
|
+
|
|
79
|
+
Follow these steps to make sure your source is configured correctly:
|
|
80
|
+
|
|
81
|
+
1. Make sure that your `action_id` or ****************channels**************** filters apply to that message, remove the filters to make sure that’s not the case.
|
|
82
|
+
|
|
83
|
+
1. Make sure that the message comes from the same Slack account that this source is configured with.
|
|
@@ -2,7 +2,7 @@ import common from "../common/base.mjs";
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
name: "New Interaction Events",
|
|
5
|
-
version: "0.0.
|
|
5
|
+
version: "0.0.2",
|
|
6
6
|
key: "slack-new-interaction-event-received",
|
|
7
7
|
description:
|
|
8
8
|
"Emit new events on new Slack [interactivity events](https://api.slack.com/interactivity) sourced from [Block Kit interactive elements](https://api.slack.com/interactivity/components), [Slash commands](https://api.slack.com/interactivity/slash-commands), or [Shortcuts](https://api.slack.com/interactivity/shortcuts).",
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
...common,
|
|
5
5
|
key: "slack-new-message-in-channels",
|
|
6
6
|
name: "New Message In Channels (Instant)",
|
|
7
|
-
version: "1.0.
|
|
7
|
+
version: "1.0.5",
|
|
8
8
|
description: "Emit new event when a new message is posted to one or more channels",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
...common,
|
|
5
5
|
key: "slack-new-reaction-added",
|
|
6
6
|
name: "New Reaction Added (Instant)",
|
|
7
|
-
version: "1.1.
|
|
7
|
+
version: "1.1.6",
|
|
8
8
|
description: "Emit new event when a member has added an emoji reaction to an item",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|