UNPKG

prisme-flow

Version:

prisme platform flow engine

70 lines (62 loc) 1.8 kB
<!-- 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-image', { category: 'bot', color: '#FFCC66', defaults: { name: { value: '' }, filename: { value: '' }, caption: { value: '', required: false } }, inputs: 1, outputs: 1, icon: 'image.png', paletteLabel: 'image', label: function() { return this.name || 'image'; } }); </script> <script type="text/x-red" data-template-name="bot-image"> <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-caption"><i class="fa fa-tag"></i> Caption</label> <input type="text" id="node-input-caption" placeholder="Caption"> </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> </script> <script type="text/x-red" data-help-name="chatbot-image"> <p> Send image, prepares the payload to send an image to the chat sender using the <code>Buffer</code> as input or loading the file if specified in the node config <em>[Telegram, Facebook, Slack, Smooch]</em>. </p> <p>The image can be passed through the payload by the upstream node:</p> <br/> <pre> msg.payload = { caption: 'I am the caption', image: msg.payload // an instance of Buffer } return msg; </pre> <p> It's also possible to wire directly a file or http node (choosing "binary buffer" in the "return" drop down) to the <code>Image node</code>. </p> </script>