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
51 lines (43 loc) • 1.94 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('chatbot-sticker', {
category: 'RedBot',
color: '#FFCC66',
defaults: {
sticker: {
value: ''
}
},
inputs: 1,
outputs: 1,
icon: 'chatbot-sticker.png',
paletteLabel: 'Sticker',
label: function() {
return this.name || 'Sticker';
}
});
</script>
<script type="text/x-red" data-template-name="chatbot-sticker">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-sticker"><i class="fa fa-file"></i> Sticker</label>
<input type="text" id="node-input-sticker" placeholder="Sticker id or URL">
</div>
</script>
<script type="text/x-red" data-help-name="chatbot-sticker"><p>The <code>Sticker node</code> allows to send a sticker to a <strong>Telegram</strong> client.</p>
<p>A sticker can be a image file (only <em>*.webp</em> format is allowed) or the id of an already loaded image on <em>Telegram</em>'s server.</p>
<p>In order to get the id of a sticker, use <a href="https://telegram.me/GetStickerIdBot">GetStickerIdBot</a></p>
<p>To use this node programmatically, just connect the input to the output of a <code>File node</code> or send the file name or URL from a upstream <code>Function node</code></p>
<pre><code>msg.payload = '/my_dir/my_file.webp'
</code></pre><p>or</p>
<pre><code>msg.payload = {
sticker: 'http://www.my_host.com/my_dir/my_file.webp'
}
</code></pre><p>Available parameters for the <code>msg.payload</code></p>
<dl class="message-properties">
<dt>sticker<span class="property-type">string or buffer</span><dd>The sticker string could be the sticker id, the path for a local file or a URL</dd>
</dl>
<p><img src="https://img.shields.io/badge/platform-Telegram-blue.svg?colorB=7cbaea" alt="Telegram"></p>
</script>