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

62 lines (57 loc) 2.32 kB
<script type="text/javascript"> RED.nodes.registerType('chatbot-video', { category: 'RedBot', color: '#FFCC66', defaults: { name: { value: '' }, filename: { value: '' }, caption: { value: '', required: false } }, inputs: 1, outputs: 1, icon: 'chatbot-video.png', paletteLabel: 'Video', label: function() { return this.name || 'Video'; }, oneditprepare: function() { $.RB_Legend(); } }); </script> <script type="text/x-red" data-template-name="chatbot-video"> <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-filename"><i class="fa fa-file"></i> Filename</label> <input type="text" id="node-input-filename" placeholder="Filename"> </div> <div class="form-row"> <label for="node-input-caption"><i class="fa fa-tag"></i> Caption</label> <input type="text" id="node-input-caption" class="platform-telegram-slack" placeholder="Caption"> </div> <div class="redbot-form-legend"></div> </script> <script type="text/x-red" data-help-name="chatbot-video"><p>The <code>Video node</code> can send a file from the local filesystem, from a Buffer payload from the upstream node or from a <code>File node</code>.</p> <p>Some file types are not supported by a specific platform, for example <em>Telegram</em> and <em>Facebook Messenger</em> only supports <em>.mp4</em>. Different video format che be sent with the <code>Document node</code>.</p> <p>To programmatically send a video, in the upstream <code>Function node</code></p> <pre><code>msg.payload.file = new Buffer(&lt;my-buffer&gt;); msg.payload.filename = &#39;my-video.mp4&#39;; return msg; </code></pre><p><code>.file</code> is a <code>Buffer</code> type. To pass the path of a local file from the upstream node</p> <pre><code>msg.filename = &#39;/my/local/my-video.mp4&#39;; return msg; </code></pre><p><img src="https://img.shields.io/badge/platform-Facebook-blue.svg" alt="Facebook"> <img src="https://img.shields.io/badge/platform-Telegram-blue.svg?colorB=7cbaea" alt="Telegram"> <img src="https://img.shields.io/badge/platform-Slack-green.svg" alt="Slack"></p> </script>