@pipedream/slack 0.4.17 → 0.4.19

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/slack",
3
- "version": "0.4.17",
3
+ "version": "0.4.19",
4
4
  "description": "Pipedream Slack Components",
5
5
  "main": "slack.app.mjs",
6
6
  "keywords": [
@@ -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.6",
7
+ version: "1.0.7",
8
8
  description: "Emit new event when a message was posted in a direct message channel",
9
9
  type: "source",
10
10
  dedupe: "unique",
@@ -20,12 +20,6 @@ export default {
20
20
  ];
21
21
  },
22
22
  },
23
- ignoreMyself: {
24
- propDefinition: [
25
- common.props.slack,
26
- "ignoreMyself",
27
- ],
28
- },
29
23
  ignoreBot: {
30
24
  propDefinition: [
31
25
  common.props.slack,
@@ -39,7 +33,7 @@ export default {
39
33
  return "New direct message received";
40
34
  },
41
35
  processEvent(event) {
42
- if (this.ignoreMyself && event.user == this.slack.mySlackId()) {
36
+ if (event.user == this.slack.mySlackId()) {
43
37
  return;
44
38
  }
45
39
  if ((this.ignoreBot) && (event.subtype == "bot_message" || event.bot_id)) {
@@ -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.8",
7
+ version: "1.1.9",
8
8
  description: "Emit new event when a member has added an emoji reaction to a message",
9
9
  type: "source",
10
10
  dedupe: "unique",
@@ -49,7 +49,7 @@ export default {
49
49
  common.props.slack,
50
50
  "icon_emoji",
51
51
  ],
52
- description: "Select one or more emojis to use as a filter. E.g. `fire`",
52
+ description: "Select one or more emojis to use as a filter. E.g. `fire, email`",
53
53
  type: "string[]",
54
54
  optional: true,
55
55
  },
@@ -60,13 +60,19 @@ export default {
60
60
  return "New reaction added";
61
61
  },
62
62
  async processEvent(event) {
63
- this.iconEmoji = typeof this.iconEmoji === "string" ?
64
- JSON.parse(this.iconEmoji) :
65
- this.iconEmoji;
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
+ }
66
72
 
67
73
  if (
68
74
  ((this.ignoreBot) && (event.subtype == "bot_message" || event.bot_id)) ||
69
- (this.iconEmoji?.length > 0 && !this.iconEmoji.includes(event.reaction))
75
+ (iconEmojiParsed?.length > 0 && !iconEmojiParsed.includes(event.reaction))
70
76
  ) {
71
77
  return;
72
78
  }