node-red-contrib-chatbot
Version:
REDBot a Chat bot for a full featured chat bot for Telegram**, Facebook Messenger and Slack. Almost no coding skills required
52 lines (47 loc) • 1.92 kB
HTML
<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-like commands, for example <code>/my-command</code></p>
<p>The node pass through the message to the output only if the message content equals the command.</p>
<p>In <strong>Telegram</strong> are available shortcuts for commands (can be defined in <code>@BotFather</code>).
In <strong>Slack</strong> commands in the form <code>/my_command</code> are used in a different way.</p>
<p>Messages that starts with <code>/</code> are not parsed by nodes like <code>Listen node</code> and <code>Rivescript node</code>.</p>
<p><img src="https://img.shields.io/badge/platform-Telegram-blue.svg?colorB=7cbaea" alt="Telegram">
<img src="https://img.shields.io/badge/platform-Facebook-blue.svg" alt="Facebook">
<img src="https://img.shields.io/badge/platform-Smooch-orange.svg" alt="Smooch"></p>
</script>