Skip to content

Commit

Permalink
send-block-kit-message (#14461)
Browse files Browse the repository at this point in the history
  • Loading branch information
michelle0927 authored Oct 30, 2024
1 parent 0b30eb9 commit b18464a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import buildBlocks from "../common/build-blocks.mjs";
import common from "../common/send-message.mjs";

export default {
...common,
...buildBlocks,
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",
type: "action",
props: {
slack: common.props.slack,
conversation: {
propDefinition: [
common.props.slack,
"conversation",
],
},
text: {
type: "string",
label: "Notification Text",
description: "Optionally provide a string for Slack to display as the new message notification (if you do not provide this, notification will be blank).",
optional: true,
},
...common.props,
...buildBlocks.props,
},
methods: {
...common.methods,
...buildBlocks.methods,
async getGeneratedBlocks() {
return await buildBlocks.run.call(this); // call buildBlocks.run with the current context
},
},
async run({ $ }) {
this.blocks = await this.getGeneratedBlocks(); // set the blocks prop for common.run to use
const resp = await common.run.call(this, {
$,
}); // call common.run with the current context
return resp;
},
};
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.7",
"version": "0.7.0",
"description": "Pipedream Slack Components",
"main": "slack.app.mjs",
"keywords": [
Expand Down

0 comments on commit b18464a

Please sign in to comment.