diff --git a/components/slack/package.json b/components/slack/package.json index 52dde1eaf3fb9..f8463eccfe612 100644 --- a/components/slack/package.json +++ b/components/slack/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/slack", - "version": "0.6.3", + "version": "0.6.4", "description": "Pipedream Slack Components", "main": "slack.app.mjs", "keywords": [ diff --git a/components/slack/sources/new-direct-message/new-direct-message.mjs b/components/slack/sources/new-direct-message/new-direct-message.mjs index 330c7d3e66b2d..03d2769b27d4f 100644 --- a/components/slack/sources/new-direct-message/new-direct-message.mjs +++ b/components/slack/sources/new-direct-message/new-direct-message.mjs @@ -5,7 +5,7 @@ export default { ...common, key: "slack-new-direct-message", name: "New Direct Message (Instant)", - version: "1.0.17", + version: "1.0.18", description: "Emit new event when a message was posted in a direct message channel", type: "source", dedupe: "unique", @@ -27,6 +27,13 @@ export default { "ignoreBot", ], }, + ignoreSelf: { + type: "boolean", + label: "Ignore Messages from Yourself", + description: "Ignores messages sent to yourself", + default: false, + optional: true, + }, }, methods: { ...common.methods, @@ -34,10 +41,9 @@ export default { return "New direct message received"; }, processEvent(event) { - if (event.user == this.slack.mySlackId()) { - return; - } - if ((this.ignoreBot) && (event.subtype == "bot_message" || event.bot_id)) { + if ((this.ignoreSelf && event.user == this.slack.mySlackId()) + || ((this.ignoreBot) && (event.subtype === "bot_message" || event.bot_id)) + || (event.subtype === "message_changed")) { return; } return event; diff --git a/components/slack/sources/new-message-in-channels/new-message-in-channels.mjs b/components/slack/sources/new-message-in-channels/new-message-in-channels.mjs index 98eb9a4de15fb..51bfb17219c11 100644 --- a/components/slack/sources/new-message-in-channels/new-message-in-channels.mjs +++ b/components/slack/sources/new-message-in-channels/new-message-in-channels.mjs @@ -6,7 +6,7 @@ export default { ...common, key: "slack-new-message-in-channels", name: "New Message In Channels (Instant)", - version: "1.0.19", + version: "1.0.20", description: "Emit new event when a new message is posted to one or more channels", type: "source", dedupe: "unique", @@ -72,7 +72,6 @@ export default { if ((this.ignoreBot) && (event.subtype == "bot_message" || event.bot_id)) { return; } - console.log(event.s); // There is no thread message type only the thread_ts field // indicates if the message is part of a thread in the event. if (this.ignoreThreads && event.thread_ts) {