forked from travisghansen/node-red-slack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslackpost.html
160 lines (140 loc) · 5.89 KB
/
slackpost.html
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!--
Copyright 2015 Adrian Lansdown
Not created by, affiliated with, or supported by Slack Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-template-name="slack">
<div class="form-row">
<label for="node-input-channelURL"><i class="fa fa-slack"></i> WebHook URL</label>
<input type="text" id="node-input-channelURL" placeholder="channelURL" style=" vertical-align: top;">
</div>
<div class="form-row">
<label for="node-input-username"><i class="fa fa-user"></i> Posting UserName</label>
<input type="text" id="node-input-username" placeholder="username" style=" vertical-align: top;">
</div>
<div class="form-row">
<label for="node-input-emojiIcon"><i class="fa fa-smile-o"></i> Emoji Icon</label>
<input type="text" id="node-input-emojiIcon" placeholder=":emojiIcon:" style=" vertical-align: top;">
</div>
<div class="form-row">
<label for="node-input-channel"><i class="fa fa-random"></i> Channel</label>
<input type="text" id="node-input-channel" placeholder="optional channel override">
</div>
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>
<script type="text/x-red" data-help-name="slack">
<p>Sends the <b>msg.payload</b> to Slack.</p>
<p>Simple way to post to a Slack channel.</p>
<p>You can optionally override the destination channel if required - either in the edit dialogue or by setting <b>msg.channel</b>.</p>
<p>You can also create <a href="https://api.slack.com/docs/attachments" target="_new">Slack attachments</a> by adding a <b>msg.attachments</b> property that must be an array.</p>
</script>
<script type="text/x-red" data-template-name="Slack Bot In">
<div class="form-row">
<label for="node-input-apiToken"><i class="fa fa-slack"></i> Bot API Token</label>
<input type="text" id="node-input-apiToken" placeholder="apiToken" style=" vertical-align: top;">
</div>
<div class="form-row">
<label for="node-input-channel"><i class="fa fa-random"></i> Channel</label>
<input type="text" id="node-input-channel" placeholder="optional channel override">
</div>
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>
<script type="text/x-red" data-help-name="Slack Bot In">
<p>Provides a listener in any channel the Slack bot is a member of.</p>
<p>Outputs the <b>msg.payload</b> as the incoming message.</p>
<p>Outputs <b>msg.SlackObj</b> with full Slack message details.</p>
<p>You can optionally limit the channel to listen to in the edit dialogue.</p>
</script>
<script type="text/x-red" data-template-name="Slack Bot Out">
<div class="form-row">
<label for="node-input-apiToken"><i class="fa fa-slack"></i> Bot API Token</label>
<input type="text" id="node-input-apiToken" placeholder="apiToken" style=" vertical-align: top;">
</div>
<div class="form-row">
<label for="node-input-channel"><i class="fa fa-random"></i> Channel</label>
<input type="text" id="node-input-channel" placeholder="optional channel override">
</div>
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>
<script type="text/x-red" data-help-name="Slack Bot Out">
<p>Sends the <b>msg.payload</b> to Slack based on the Bot API token provided.</p>
<p>You can optionally override the destination channel if required - either in the edit dialogue or by setting <b>msg.channel</b>.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('slack',{
category: 'social',
defaults: {
name: {value:""},
channelURL: {value:"", required:true},
username: {value:""},
emojiIcon: {value:""},
channel: {value:""}
},
color:"#4C9689",
icon: "hash.png",
align: "right",
inputs:1,
outputs:0,
label: function() {
return this.name||"slack";
},
labelStyle: function() {
return this.name?"node_label_italic":"";
}
});
RED.nodes.registerType('Slack Bot In',{
category: 'social',
defaults: {
name: {value:""},
apiToken: {value:"", required:true},
channel: {value:""}
},
color:"#4C9689",
icon: "hash.png",
align: "right",
inputs:0,
outputs:1,
label: function() {
return this.name||"";
},
labelStyle: function() {
return this.name?"node_label_italic":"";
}
});
RED.nodes.registerType('Slack Bot Out',{
category: 'social',
defaults: {
name: {value:""},
apiToken: {value:"", required:true},
channel: {value:""}
},
color:"#4C9689",
icon: "hash.png",
align: "right",
inputs:1,
outputs:0,
label: function() {
return this.name||"";
},
labelStyle: function() {
return this.name?"node_label_italic":"";
}
});
</script>