Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-add-emoji-reaction",
name: "Add Emoji Reaction",
description: "Add an emoji reaction to a message. [See the documentation](https://api.slack.com/methods/reactions.add)",
version: "0.0.11",
version: "0.0.12",
type: "action",
props: {
slack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "slack-archive-channel",
name: "Archive Channel",
description: "Archive a channel. [See the documentation](https://api.slack.com/methods/conversations.archive)",
version: "0.0.19",
version: "0.0.20",
type: "action",
props: {
slack,
Expand Down
5 changes: 4 additions & 1 deletion components/slack/actions/common/send-message.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ export default {
},
};
},
getChannelId() {
return this.conversation ?? this.reply_channel;
},
},
async run({ $ }) {
let blocks = this.blocks;
Expand Down Expand Up @@ -207,7 +210,7 @@ export default {

const obj = {
text: this.text,
channel: this.conversation ?? this.reply_channel,
channel: await this.getChannelId(),
attachments: this.attachments,
unfurl_links: this.unfurl_links,
unfurl_media: this.unfurl_media,
Expand Down
2 changes: 1 addition & 1 deletion components/slack/actions/create-channel/create-channel.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-create-channel",
name: "Create a Channel",
description: "Create a new channel. [See the documentation](https://api.slack.com/methods/conversations.create)",
version: "0.0.20",
version: "0.0.21",
type: "action",
props: {
slack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-create-reminder",
name: "Create Reminder",
description: "Create a reminder. [See the documentation](https://api.slack.com/methods/reminders.add)",
version: "0.0.20",
version: "0.0.21",
type: "action",
props: {
slack,
Expand Down
2 changes: 1 addition & 1 deletion components/slack/actions/delete-file/delete-file.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-delete-file",
name: "Delete File",
description: "Delete a file. [See the documentation](https://api.slack.com/methods/files.delete)",
version: "0.0.19",
version: "0.0.20",
type: "action",
props: {
slack,
Expand Down
2 changes: 1 addition & 1 deletion components/slack/actions/delete-message/delete-message.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-delete-message",
name: "Delete Message",
description: "Delete a message. [See the documentation](https://api.slack.com/methods/chat.delete)",
version: "0.0.19",
version: "0.0.20",
type: "action",
props: {
slack,
Expand Down
2 changes: 1 addition & 1 deletion components/slack/actions/find-message/find-message.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-find-message",
name: "Find Message",
description: "Find a Slack message. [See the documentation](https://api.slack.com/methods/search.messages)",
version: "0.0.19",
version: "0.0.20",
type: "action",
props: {
slack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-find-user-by-email",
name: "Find User by Email",
description: "Find a user by matching against their email. [See the documentation](https://api.slack.com/methods/users.lookupByEmail)",
version: "0.0.19",
version: "0.0.20",
type: "action",
props: {
slack,
Expand Down
2 changes: 1 addition & 1 deletion components/slack/actions/get-file/get-file.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-get-file",
name: "Get File",
description: "Return information about a file. [See the documentation](https://api.slack.com/methods/files.info)",
version: "0.0.19",
version: "0.0.20",
type: "action",
props: {
slack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-invite-user-to-channel",
name: "Invite User to Channel",
description: "Invite a user to an existing channel. [See the documentation](https://api.slack.com/methods/conversations.invite)",
version: "0.0.19",
version: "0.0.20",
type: "action",
props: {
slack,
Expand Down
2 changes: 1 addition & 1 deletion components/slack/actions/kick-user/kick-user.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "slack-kick-user",
name: "Kick User",
description: "Remove a user from a conversation. [See the documentation](https://api.slack.com/methods/conversations.kick)",
version: "0.0.19",
version: "0.0.20",
type: "action",
props: {
slack,
Expand Down
2 changes: 1 addition & 1 deletion components/slack/actions/list-channels/list-channels.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-list-channels",
name: "List Channels",
description: "Return a list of all channels in a workspace. [See the documentation](https://api.slack.com/methods/conversations.list)",
version: "0.0.19",
version: "0.0.20",
type: "action",
props: {
slack,
Expand Down
2 changes: 1 addition & 1 deletion components/slack/actions/list-files/list-files.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-list-files",
name: "List Files",
description: "Return a list of files within a team. [See the documentation](https://api.slack.com/methods/files.list)",
version: "0.0.47",
version: "0.0.48",
type: "action",
props: {
slack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-list-group-members",
name: "List Group Members",
description: "List all users in a User Group. [See the documentation](https://api.slack.com/methods/usergroups.users.list)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
slack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-list-members-in-channel",
name: "List Members in Channel",
description: "Retrieve members of a channel. [See the documentation](https://api.slack.com/methods/conversations.members)",
version: "0.0.19",
version: "0.0.20",
type: "action",
props: {
slack,
Expand Down
2 changes: 1 addition & 1 deletion components/slack/actions/list-replies/list-replies.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-list-replies",
name: "List Replies",
description: "Retrieve a thread of messages posted to a conversation. [See the documentation](https://api.slack.com/methods/conversations.replies)",
version: "0.0.19",
version: "0.0.20",
type: "action",
props: {
slack,
Expand Down
2 changes: 1 addition & 1 deletion components/slack/actions/list-users/list-users.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-list-users",
name: "List Users",
description: "Return a list of all users in a workspace. [See the documentation](https://api.slack.com/methods/users.list)",
version: "0.0.19",
version: "0.0.20",
type: "action",
props: {
slack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "slack-reply-to-a-message",
name: "Reply to a Message Thread",
description: "Send a message as a threaded reply. See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
version: "0.1.24",
version: "0.1.25",
type: "action",
props: {
slack: common.props.slack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "slack-send-block-kit-message",
name: "Build and Send a Block Kit Message",
description: "Configure custom blocks and send to a channel, group, or user. [See the documentation](https://api.slack.com/tools/block-kit-builder).",
version: "0.4.0",
version: "0.4.1",
type: "action",
props: {
slack: common.props.slack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "slack-send-large-message",
name: "Send a Large Message (3000+ characters)",
description: "Send a large message (more than 3000 characters) to a channel, group or user. See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
version: "0.0.19",
version: "0.0.20",
type: "action",
props: {
slack: common.props.slack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "slack-send-message-advanced",
name: "Send Message (Advanced)",
description: "Customize advanced setttings and send a message to a channel, group or user. See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
version: "0.0.2",
version: "0.0.3",
type: "action",
props: {
slack: common.props.slack,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import common from "../common/send-message.mjs";
import constants from "../../common/constants.mjs";

export default {
...common,
key: "slack-send-message-to-channel",
name: "Send Message to Channel",
description: "Send a message to a public or private channel. [See the documentation](https://api.slack.com/methods/chat.postMessage)",
version: "0.0.1",
type: "action",
props: {
slack: common.props.slack,
conversation: {
propDefinition: [
common.props.slack,
"conversation",
() => ({
types: [
constants.CHANNEL_TYPE.PUBLIC,
constants.CHANNEL_TYPE.PRIVATE,
],
}),
],
description: "Select a public or private channel",
},
text: {
propDefinition: [
common.props.slack,
"text",
],
},
mrkdwn: {
propDefinition: [
common.props.slack,
"mrkdwn",
],
},
...common.props,
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import common from "../common/send-message.mjs";
import constants from "../../common/constants.mjs";
import { ConfigurationError } from "@pipedream/platform";

export default {
...common,
key: "slack-send-message-to-user-or-group",
name: "Send Message to User or Group",
description: "Send a message to a user or group. [See the documentation](https://api.slack.com/methods/chat.postMessage)",
version: "0.0.1",
type: "action",
props: {
slack: common.props.slack,
users: {
propDefinition: [
common.props.slack,
"user",
],
type: "string[]",
label: "Users",
description: "Select the user(s) to message",
optional: true,
},
conversation: {
propDefinition: [
common.props.slack,
"conversation",
() => ({
types: [
constants.CHANNEL_TYPE.MPIM,
],
}),
],
description: "Select the group to message",
optional: true,
},
text: {
propDefinition: [
common.props.slack,
"text",
],
},
mrkdwn: {
propDefinition: [
common.props.slack,
"mrkdwn",
],
},
...common.props,
},
methods: {
...common.methods,
openConversation(args = {}) {
return this.slack.makeRequest({
method: "conversations.open",
...args,
});
},
async getChannelId() {
if (!this.conversation && !this.users?.length) {
throw new ConfigurationError("Must select a group or user(s) to message");
}

if (this.conversation) {
return this.conversation;
}
const { channel: { id } } = await this.openConversation({
users: this.users.join(),
});
return id;
},
},
};
2 changes: 1 addition & 1 deletion components/slack/actions/send-message/send-message.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "slack-send-message",
name: "Send Message",
description: "Send a message to a user, group, private channel or public channel. [See the documentation](https://api.slack.com/methods/chat.postMessage)",
version: "0.0.15",
version: "0.0.16",
type: "action",
props: {
slack: common.props.slack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-set-channel-description",
name: "Set Channel Description",
description: "Change the description or purpose of a channel. [See the documentation](https://api.slack.com/methods/conversations.setPurpose)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
slack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-set-channel-topic",
name: "Set Channel Topic",
description: "Set the topic on a selected channel. [See the documentation](https://api.slack.com/methods/conversations.setTopic)",
version: "0.0.19",
version: "0.0.20",
type: "action",
props: {
slack,
Expand Down
2 changes: 1 addition & 1 deletion components/slack/actions/set-status/set-status.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-set-status",
name: "Set Status",
description: "Set the current status for a user. [See the documentation](https://api.slack.com/methods/users.profile.set)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
slack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-update-group-members",
name: "Update Groups Members",
description: "Update the list of users for a User Group. [See the documentation](https://api.slack.com/methods/usergroups.users.update)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
slack,
Expand Down
2 changes: 1 addition & 1 deletion components/slack/actions/update-message/update-message.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "slack-update-message",
name: "Update Message",
description: "Update a message. [See the documentation](https://api.slack.com/methods/chat.update)",
version: "0.1.19",
version: "0.1.20",
type: "action",
props: {
slack,
Expand Down
2 changes: 1 addition & 1 deletion components/slack/actions/update-profile/update-profile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "slack-update-profile",
name: "Update Profile",
description: "Update basic profile field such as name or title. [See the documentation](https://api.slack.com/methods/users.profile.set)",
version: "0.0.19",
version: "0.0.20",
type: "action",
props: {
slack,
Expand Down
2 changes: 1 addition & 1 deletion components/slack/actions/upload-file/upload-file.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "slack-upload-file",
name: "Upload File",
description: "Upload a file. [See the documentation](https://api.slack.com/methods/files.upload)",
version: "0.0.23",
version: "0.0.24",
type: "action",
props: {
slack,
Expand Down
Loading
Loading