Skip to content

Commit 6efa73f

Browse files
committed
send-block-kit-message
1 parent 46e7530 commit 6efa73f

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import buildBlocks from "../common/build-blocks.mjs";
2+
import common from "../common/send-message.mjs";
3+
4+
export default {
5+
...common,
6+
...buildBlocks,
7+
key: "slack-send-block-kit-message",
8+
name: "Build and Send a Block Kit Message",
9+
description: "Configure custom blocks and send to a channel, group, or user. [See the documentation](https://api.slack.com/tools/block-kit-builder).",
10+
version: "0.4.0",
11+
type: "action",
12+
props: {
13+
slack: common.props.slack,
14+
conversation: {
15+
propDefinition: [
16+
common.props.slack,
17+
"conversation",
18+
],
19+
},
20+
text: {
21+
type: "string",
22+
label: "Notification Text",
23+
description: "Optionally provide a string for Slack to display as the new message notification (if you do not provide this, notification will be blank).",
24+
optional: true,
25+
},
26+
...common.props,
27+
...buildBlocks.props,
28+
},
29+
methods: {
30+
...common.methods,
31+
...buildBlocks.methods,
32+
async getGeneratedBlocks() {
33+
return await buildBlocks.run.call(this); // call buildBlocks.run with the current context
34+
},
35+
},
36+
async run({ $ }) {
37+
this.blocks = await this.getGeneratedBlocks(); // set the blocks prop for common.run to use
38+
const resp = await common.run.call(this, {
39+
$,
40+
}); // call common.run with the current context
41+
return resp;
42+
},
43+
};

components/slack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/slack",
3-
"version": "0.6.7",
3+
"version": "0.7.0",
44
"description": "Pipedream Slack Components",
55
"main": "slack.app.mjs",
66
"keywords": [

0 commit comments

Comments
 (0)