UNPKG

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.91 kB
<script type="text/javascript"> $.RedBot.registerType('chatbot-animation', { category: $.RedBot.config.name, color: '#FFCC66', defaults: { animation: { value: '' } }, inputs: 1, outputs: 1, icon: 'chatbot-sticker.png', paletteLabel: 'Animation', label: function() { return this.name || 'Animation'; } }); </script> <script type="text/x-red" data-template-name="chatbot-animation"> <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-animation">Animation</label> <input type="text" id="node-input-animation" placeholder="Animation id or URL"> </div> </script> <script type="text/x-red" data-help-name="chatbot-animation"><p>The <code>Animation node</code> sends an animated GIF or video to the chatbot from a local file or from a URL or from a Buffer passed by an upstream node (the simplest way to use it to chain with to <code>File node</code> or a <code>Http node</code>).</p> <p>To programmatically send an animation with a <code>Function node</code></p> <pre><code>msg.payload = &#39;/my_dir/my_image.gif&#39; </code></pre><p>or</p> <pre><code>msg.payload = { caption: &#39;I am the caption&#39;, image: &#39;http://www.my_host.com/my_dir/my_image.gif&#39; } </code></pre><p>Available parameters for the <code>msg.payload</code></p> <dl class="message-properties"> <dt>animation<span class="property-type">string or buffer</span><dd>The image string could be a path for a local file or a URL (context variables can be used)</dd> <dt>caption<span class="property-type">string</span><dd>Caption of the image. Only for Telegram, Slack and Viber</dd> </dl> <p><img src="https://img.shields.io/badge/platform-Telegram-blue.svg?colorB=7cbaea" alt="Telegram"></p> </script>