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

Slack Bot - update Channel prop description #14062

Merged
merged 5 commits into from
Sep 25, 2024
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
4 changes: 2 additions & 2 deletions 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.14",
version: "0.0.15",
type: "action",
props: {
slack: common.props.slack,
Expand All @@ -21,7 +21,7 @@ export default {
conversation: {
propDefinition: [
common.props.slack,
"channelId",
"conversation",
(c) => ({
types: c.channelType === "Channels"
? [
Expand Down
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.6",
"version": "0.6.7",
"description": "Pipedream Slack Components",
"main": "slack.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export default {
}),
key: "slack_bot-add-emoji-reaction",
description: "Add an emoji reaction to a message. [See the documentation](https://api.slack.com/methods/reactions.add)",
version: "0.0.1",
version: "0.0.2",
};
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ export default {
}),
key: "slack_bot-archive-channel",
description: "Archive a channel (Bot). [See the documentation](https://api.slack.com/methods/conversations.archive)",
version: "0.0.3",
version: "0.0.4",
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export default {
}),
key: "slack_bot-create-channel",
description: "Create a new channel (Bot). [See the documentation](https://api.slack.com/methods/conversations.create)",
version: "0.0.3",
version: "0.0.4",
};
2 changes: 1 addition & 1 deletion components/slack_bot/actions/delete-file/delete-file.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export default {
}),
key: "slack_bot-delete-file",
description: "Delete a file (Bot). [See the documentation](https://api.slack.com/methods/files.delete)",
version: "0.0.3",
version: "0.0.4",
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ export default {
}),
key: "slack_bot-delete-message",
description: "Delete a message (Bot). [See the documentation](https://api.slack.com/methods/chat.delete)",
version: "0.0.3",
version: "0.0.4",
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export default {
}),
key: "slack_bot-find-user-by-email",
description: "Find a user by matching against their email (Bot). [See the documentation](https://api.slack.com/methods/users.lookupByEmail)",
version: "0.0.3",
version: "0.0.4",
};
2 changes: 1 addition & 1 deletion components/slack_bot/actions/get-file/get-file.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export default {
}),
key: "slack_bot-get-file",
description: "Return information about a file (Bot). [See the documentation](https://api.slack.com/methods/files.info)",
version: "0.0.3",
version: "0.0.4",
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export default {
}),
key: "slack_bot-invite-user-to-channel",
description: "Invite a user to an existing channel (Bot). [See the documentation](https://api.slack.com/methods/conversations.invite)",
version: "0.0.3",
version: "0.0.4",
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export default {
}),
key: "slack_bot-list-channels",
description: "Return a list of all channels in a workspace (Bot). [See the documentation](https://api.slack.com/methods/conversations.list)",
version: "0.0.3",
version: "0.0.4",
};
2 changes: 1 addition & 1 deletion components/slack_bot/actions/list-files/list-files.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ export default {
}),
key: "slack_bot-list-files",
description: "Return a list of files within a team (Bot). [See the documentation](https://api.slack.com/methods/files.list)",
version: "0.0.3",
version: "0.0.4",
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export default {
}),
key: "slack_bot-list-group-members",
description: "List all users in a User Group (Bot). [See the documentation](https://api.slack.com/methods/usergroups.users.list)",
version: "0.0.1",
version: "0.0.2",
};
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ export default {
}),
key: "slack_bot-list-members-in-channel",
description: "Retrieve members of a channel (Bot). [See the documentation](https://api.slack.com/methods/conversations.members)",
version: "0.0.3",
version: "0.0.4",
};
2 changes: 1 addition & 1 deletion components/slack_bot/actions/list-replies/list-replies.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ export default {
}),
key: "slack_bot-list-replies",
description: "Retrieve a thread of messages posted to a conversation (Bot). [See the documentation](https://api.slack.com/methods/conversations.replies)",
version: "0.0.4",
version: "0.0.5",
};
2 changes: 1 addition & 1 deletion components/slack_bot/actions/list-users/list-users.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export default {
}),
key: "slack_bot-list-users",
description: "Return a list of all users in a workspace (Bot). [See the documentation](https://api.slack.com/methods/users.list)",
version: "0.0.3",
version: "0.0.4",
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ export default {
}),
key: "slack_bot-reply-to-a-message",
description: "Send a message as a threaded reply (Bot). See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
version: "0.0.4",
version: "0.0.5",
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ export default {
}),
key: "slack_bot-send-large-message",
description: "Send a large message (more than 3000 characters) to a channel, group or user (Bot). See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
version: "0.0.4",
version: "0.0.5",
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ export default {
}),
key: "slack_bot-send-message-advanced",
description: "Customize advanced setttings and send a message to a channel, group or user (Bot). See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
version: "0.0.4",
version: "0.0.5",
};
2 changes: 1 addition & 1 deletion components/slack_bot/actions/send-message/send-message.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ export default {
}),
key: "slack_bot-send-message",
description: "Send a message to a user, group, private channel or public channel (Bot). See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
version: "0.0.3",
version: "0.0.4",
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export default {
}),
key: "slack_bot-set-channel-description",
description: "Change the description or purpose of a channel (Bot). [See the documentation](https://api.slack.com/methods/conversations.setPurpose)",
version: "0.0.1",
version: "0.0.2",
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export default {
}),
key: "slack_bot-set-channel-topic",
description: "Set the topic on a selected channel (Bot). [See the documentation](https://api.slack.com/methods/conversations.setTopic)",
version: "0.0.3",
version: "0.0.4",
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export default {
}),
key: "slack_bot-update-group-members",
description: "Update the list of users for a User Group (Bot). [See docs here](https://api.slack.com/methods/usergroups.users.update)",
version: "0.0.1",
version: "0.0.2",
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ export default {
}),
key: "slack_bot-update-message",
description: "Update a message (Bot). [See the documentation](https://api.slack.com/methods/chat.update)",
version: "0.0.3",
version: "0.0.4",
};
2 changes: 1 addition & 1 deletion components/slack_bot/actions/upload-file/upload-file.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export default {
}),
key: "slack_bot-upload-file",
description: "Upload a file (Bot). [See the documentation](https://api.slack.com/methods/files.upload)",
version: "0.0.4",
version: "0.0.5",
};
9 changes: 9 additions & 0 deletions components/slack_bot/common/utils.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import app from "../slack_bot.app.mjs";

const CONVERSATION_PERMISSION_MESSAGE = "In order to list a Slack channel, **your bot must be a member of that channel**, and in order to list private channels, your bot must have the `groups:read` scope in the `OAuth & Permissions` settings in Slack for this bot.";

async function streamIterator(stream) {
let resources = [];
for await (const resource of stream) {
Expand All @@ -23,6 +25,12 @@ function buildPropDefinitions({
};
}

if (key === "conversation") {
prop.description = prop.description
? `${prop.description} ${CONVERSATION_PERMISSION_MESSAGE}`
: `Select a public or private channel, or a user or group. ${CONVERSATION_PERMISSION_MESSAGE}`;
}

const [
, ...propDefinitionItems
] = prop.propDefinition;
Expand Down Expand Up @@ -87,4 +95,5 @@ function buildAppProps({
export default {
streamIterator,
buildAppProps,
CONVERSATION_PERMISSION_MESSAGE,
};
2 changes: 1 addition & 1 deletion components/slack_bot/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/slack_bot",
"version": "0.5.4",
"version": "0.5.5",
"description": "Pipedream Slack_bot Components",
"main": "slack_bot.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import common from "../common/base.mjs";
import constants from "../../common/constants.mjs";
import utils from "../../common/utils.mjs";

export default {
...common,
key: "slack_bot-new-direct-message",
name: "New Direct Message",
version: "0.0.3",
version: "0.0.4",
description: "Emit new event when a message is posted in a direct message channel (Bot). To open a conversation, use the Pipedream Action \"Send a Direct Message\" to send a message from the Bot, or enable direct messages to the Bot in your App Settings (Settings->App Home->Show Tabs->Messages Tab), and send a direct message to the Bot.",
type: "source",
dedupe: "unique",
Expand All @@ -22,7 +23,7 @@ export default {
}),
],
label: "User Channel",
description: "Events will only be emitted for direct messages between this user and the Bot.",
description: `Events will only be emitted for direct messages between this user and the Bot. ${utils.CONVERSATION_PERMISSION_MESSAGE}`,
},
},
methods: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import common from "../common/base.mjs";
import constants from "../../common/constants.mjs";
import utils from "../../common/utils.mjs";

export default {
...common,
key: "slack_bot-new-message-in-channel",
name: "New Message In Channel",
version: "0.0.3",
version: "0.0.4",
description: "Emit new event when a new message is posted to a public, private or group channel (Bot)",
type: "source",
dedupe: "unique",
Expand All @@ -23,6 +24,7 @@ export default {
],
}),
],
description: `Select the channel's ID. ${utils.CONVERSATION_PERMISSION_MESSAGE}`,
},
},
methods: {
Expand Down
Loading