@pipedream/slack 0.4.16 → 0.4.18
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/package.json
CHANGED
|
@@ -4,8 +4,8 @@ export default {
|
|
|
4
4
|
...common,
|
|
5
5
|
key: "slack-new-reaction-added",
|
|
6
6
|
name: "New Reaction Added (Instant)",
|
|
7
|
-
version: "1.1.
|
|
8
|
-
description: "Emit new event when a member has added an emoji reaction to
|
|
7
|
+
version: "1.1.9",
|
|
8
|
+
description: "Emit new event when a member has added an emoji reaction to a message",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
@@ -44,6 +44,15 @@ export default {
|
|
|
44
44
|
"ignoreBot",
|
|
45
45
|
],
|
|
46
46
|
},
|
|
47
|
+
iconEmoji: {
|
|
48
|
+
propDefinition: [
|
|
49
|
+
common.props.slack,
|
|
50
|
+
"icon_emoji",
|
|
51
|
+
],
|
|
52
|
+
description: "Select one or more emojis to use as a filter. E.g. `fire, email`",
|
|
53
|
+
type: "string[]",
|
|
54
|
+
optional: true,
|
|
55
|
+
},
|
|
47
56
|
},
|
|
48
57
|
methods: {
|
|
49
58
|
...common.methods,
|
|
@@ -51,7 +60,20 @@ export default {
|
|
|
51
60
|
return "New reaction added";
|
|
52
61
|
},
|
|
53
62
|
async processEvent(event) {
|
|
54
|
-
|
|
63
|
+
let iconEmojiParsed = [];
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
iconEmojiParsed = typeof this.iconEmoji === "string" ?
|
|
67
|
+
JSON.parse(this.iconEmoji) :
|
|
68
|
+
this.iconEmoji;
|
|
69
|
+
} catch (error) {
|
|
70
|
+
iconEmojiParsed = this.iconEmoji.replace(/\s+/g, "").split(",");
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (
|
|
74
|
+
((this.ignoreBot) && (event.subtype == "bot_message" || event.bot_id)) ||
|
|
75
|
+
(iconEmojiParsed?.length > 0 && !iconEmojiParsed.includes(event.reaction))
|
|
76
|
+
) {
|
|
55
77
|
return;
|
|
56
78
|
}
|
|
57
79
|
|