forked from guidone/node-red-contrib-chatbot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchatbot-command.html
More file actions
51 lines (47 loc) · 1.36 KB
/
chatbot-command.html
File metadata and controls
51 lines (47 loc) · 1.36 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
46
47
48
49
<script type="text/javascript">
RED.nodes.registerType('chatbot-command', {
category: 'RedBot Parsers',
color: '#FFCC66',
defaults: {
name: {
value: ''
},
command: {
value: '/'
}
},
inputs: 1,
outputs: 1,
paletteLabel: 'Command',
icon: 'chatbot-command.png',
label: function() {
var command = this.command;
if (command != null && command.length > 0) {
if (command[0] != '/') {
command = '/' + command;
}
return command;
} else {
return 'Command';
}
}
});
</script>
<script type="text/x-red" data-template-name="chatbot-command">
<div class="form-row">
<label for="node-input-command"><i class="icon-tag"></i> Command</label>
<input type="text" id="node-input-command" placeholder="Command">
<div style="max-width: 460px;font-size: 12px;color: #999999;line-height: 14px;margin-top:5px;">
The command to listen to, should start with <code>/</code>
</div>
</div>
</script>
<script type="text/x-red" data-help-name="chatbot-command">
<p>
Listen for Telegram command like <code>/my-command</code>, pass through the payload to the output only if the
message content equals the command.
</p>
<p>
In Telegram are available shortcuts for commands (can be defined in <code>@BotFather</code>).
</p>
</script>