-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathslack-utils.js
More file actions
45 lines (43 loc) · 1.15 KB
/
slack-utils.js
File metadata and controls
45 lines (43 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
class SlackUtils {
static createVideoBlock(videoUrl, title, thumbnailUrl) {
return {
type: 'video',
title: {
type: 'plain_text',
text: title,
},
video_url: videoUrl,
alt_text: 'Vbrick Video Embed',
thumbnail_url: thumbnailUrl,
};
}
static searchResultsItem(tenantDomain, url, title, thumbnailUrl, videoId, channelId) {
return [
{
type: 'divider'
},
this.createVideoBlock(url, title, thumbnailUrl),
{
type: 'section',
text: {
type: 'mrkdwn',
text: `<https://${tenantDomain}/#/videos/${videoId}>`
},
}, {
type: 'actions',
elements: [
{
type: 'button',
action_id: 'post_to_channel',
text: {
type: 'plain_text',
text: 'Share in Channel'
},
value: `search|${videoId}|${channelId}`,
}
]
}
];
}
}
module.exports = SlackUtils;