Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Slack - New Direct Message (Instant) trigger #12435

Merged
merged 4 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading