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

81 lines (73 loc) 2.93 kB
<script type="text/javascript"> RED.nodes.registerType('chatbot-location', { category: 'RedBot', color: '#FFCC66', defaults: { name: { value: '' }, latitude: { value: '', validate: function(value) { return value == null || $.trim(value) == '' || RED.validators.number()(value); } }, longitude: { value: '', validate: function(value) { return value == null || $.trim(value) == '' || RED.validators.number()(value); } }, place: { value: '', required: false } }, inputs: 1, outputs: 1, paletteLabel: 'Location', icon: 'chatbot-location.png', label: function() { return this.name || 'Location'; } }); </script> <script type="text/x-red" data-template-name="chatbot-location"> <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-name">Latitude</label> <input type="text" id="node-input-latitude" placeholder="Latitude" style="width: 30%;"> <input type="text" id="node-input-longitude" placeholder="Longitude" style="width: 30%;"> </div> <div class="form-row"> <label for="node-input-place">Place</label> <input type="text" id="node-input-place" placeholder="Place"> <div style="max-width: 460px;font-size: 12px;color: #999999;line-height: 14px;margin-top:5px;"> Label next the map (for example the physical address <i>"corso Sempione, 12 Milano"</i>), only available for transport <b>Facebook</b> </div> </div> </script> <script type="text/x-red" data-help-name="chatbot-location"><p>Send a position message to the chatbot (a tiny clicable map).</p> <p>It&#39;s possible to programmatically send a location node by passing the parameters from a upstream <code>Function node</code>:</p> <pre><code>msg.payload.latitude = 45.00; msg.payload.longitude = 23.00; return msg; </code></pre><p>Available parameters for the <code>msg.payload</code></p> <dl class="message-properties"> <dt>latitude<span class="property-type">float</span><dd>The position latitude</dd> <dt>longitude<span class="property-type">float</span><dd>The position longitude</dd> <dt>place<span class="property-type">string</span><dd>The position description</dd> </dl> <p>Platform exceptions</p> <ul> <li><strong>Telegram</strong> only supports live location when using the <em>webHook</em> connection mode and not <em>polling</em></li> </ul> <p><img src="https://img.shields.io/badge/platform-Telegram-blue.svg?colorB=7cbaea" alt="Telegram"> <img src="https://img.shields.io/badge/platform-Facebook-blue.svg" alt="Facebook"> <img src="https://img.shields.io/badge/platform-Slack-green.svg" alt="Slack"> <img src="https://img.shields.io/badge/platform-Viber-8079d0.svg" alt="Viber"></p> </script>