Skip to content

Commit

Permalink
add ignoreSelf prop
Browse files Browse the repository at this point in the history
  • Loading branch information
michelle0927 committed Jun 14, 2024
1 parent fefc43c commit 2e1ab1b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/slack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/slack",
"version": "0.6.3",
"version": "0.6.4",
"description": "Pipedream Slack Components",
"main": "slack.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -27,14 +27,21 @@ export default {
"ignoreBot",
],
},
ignoreSelf: {
type: "boolean",
label: "Ignore Messages from Yourself",
description: "Ignores messages sent to yourself",
default: false,
optional: true,
},
},
methods: {
...common.methods,
getSummary() {
return "New direct message received";
},
processEvent(event) {
if (event.user == this.slack.mySlackId()) {
if (this.ignoreSelf && event.user == this.slack.mySlackId()) {
return;
}
if ((this.ignoreBot) && (event.subtype == "bot_message" || event.bot_id)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2e1ab1b

Please sign in to comment.