-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpayloads.js
87 lines (85 loc) · 2.33 KB
/
payloads.js
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
module.exports = {
openModal: context => {
return {
trigger_id: context.trigger_id,
view: {
type: "modal",
title: {
type: "plain_text",
text: "Characters List",
emoji: true
},
close: {
type: "plain_text",
text: "Close",
emoji: true
},
blocks: [
{
type: "header",
text: {
type: "plain_text",
text: "Character List",
emoji: true
}
},
{
type: "section",
text: {
type: "mrkdwn",
text: "A = 3 B = 1 C = 2 D = 2 E = 3 F = 1 G = 2 H = 2 I = 3 J = 1 K = 1 L = 2 M = 2 N = 2 O = 3 P = 2 Q = 1 R = 3 S = 2 T = 2 U = 2 V = 1 W = 1 X = 1 Y = 1 Z = 1 1 = 1 2 = 1 3 = 1 4 = 1 5 = 1 6 = 1 7 = 1 8 = 1 9 = 1 0 = 1 @ = 1 # = 1 & = 1"
}
},
{
type: "header",
text: {
type: "plain_text",
text: "Alternative Character List",
emoji: true
}
},
{
type: "section",
text: {
type: "mrkdwn",
text: " C = U E = 3 I = 1 M = W O = 0 S = S U = C W = M Z = Z 1 = I 2 = S 3 = E 6 = 9 9 = 6 0 = O"
}
}
]
}
}
},
message: context => {
const button = {
type: "actions",
elements: [
{
type: "button",
action_id: "character_list",
text: {
type: "plain_text",
emoji: true,
text: "Character List"
},
value: "open"
}
]
};
let view = {
response_type: "in_channel",
blocks: [
{
type: "section",
text: {
type: "mrkdwn",
text: "*Original Text:* " + context.text + " \n" + context.newText
}
},
]
};
if (context.newText.includes(':x: :upside_down_face:')) {
view.blocks.push(button);
}
return view;
}
}