prisme-flow
Version:
prisme platform flow engine
60 lines (51 loc) • 1.5 kB
HTML
<!--
Created by prisme.io on 09/06/2017.
@author <a href="mailto:hello@prisme.io">savane vamara</a> (prisme.io)
-->
<script type="text/javascript">
RED.nodes.registerType('bot-command', {
category: 'bot-parsers',
color: '#FFCC66',
defaults: {
name: {
value: ''
},
command: {
value: '/'
}
},
inputs: 1,
outputs: 1,
paletteLabel: 'command',
icon: '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="bot-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>