UNPKG

prisme-flow

Version:

prisme platform flow engine

207 lines (182 loc) 7.72 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('telegram bot', { category: 'config', defaults: { botname: { value: "fooBot", required: true }, usernames: { value: "", required: false }, chatids: { value: "", required: false } }, credentials: { token: { type: "text" } }, label: function () { return this.botname; } }); </script> <script type="text/x-red" data-template-name="telegram bot"> <div class="form-row"> <label for="node-config-input-botname"><i class="icon-bookmark"></i> Bot-Name</label> <input type="text" id="node-config-input-botname"> </div> <div class="form-row"> <label for="node-config-input-token"><i class="icon-tag"></i> Token</label> <input type="text" id="node-config-input-token"> </div> <div class="form-row"> <label for="node-config-input-usernames"><i class="icon-user"></i> Users</label> <input type="text" id="node-config-input-usernames"> </div> <div class="form-row"> <label for="node-config-input-chatids"><i class="icon-comment"></i> ChatIds</label> <input type="text" id="node-config-input-chatids"> </div> </script> <script type="text/x-red" data-help-name="telegram bot"> <p>A configuration node that holds the token of the telegram bot. It communicates with the telegram server. Do not create several configurations nodes with the same token! The usernames and chat ids properties can be used to limit authorization to the bot. Enter values in json array format e.g. [a,b,c] Usernames and chat ids are optional. Leave field blank if you do not want to use this feature.</p> </script> <!-- ------------------------------------------------------------------------------------------ --> <script type="text/javascript"> RED.nodes.registerType('telegram receiver', { category: 'social', color: '#a6bbcf', defaults: { name: { value: "" }, bot: { value:"", type: "telegram bot", required: true }, saveDataDir: { value: "" } }, inputs: 0, outputs: 2, icon: "telegram.png", label: function () { return this.name || "telegram receiver"; } }); </script> <script type="text/x-red" data-template-name="telegram receiver"> <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-bot"><i class="icon-bookmark"></i> Bot</label> <input type="text" id="node-input-bot" placeholder="Bot"> </div> <div class="form-row"> <label for="node-input-saveDataDir"><i class="icon-hdd"></i> Download Directory</label> <input type="text" id="node-input-saveDataDir" placeholder="Download directory"> </div> </script> <script type="text/x-red" data-help-name="telegram receiver"> <p>A telegram node that triggers the output when some message is received from the chat. Message is send to output 1 if it comes from an authorized user. Message is send to output 2 if it comes from an non-authorized user. msg.payload contains the parsed data. msg.originalMessage contains the raw data object from the underlying library.</p> </script> <!-- ------------------------------------------------------------------------------------------ --> <script type="text/javascript"> RED.nodes.registerType('telegram command', { category: 'social', color: '#a6bbcf', defaults: { name: { value: "" }, command: { value: ""}, bot: { value: "", type: "telegram bot", required: true } }, inputs: 0, outputs: 2, icon: "telegram.png", label: function () { return this.name || "telegram command"; } }); </script> <script type="text/x-red" data-template-name="telegram command"> <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-command"><i class="icon-envelope"></i> Command</label> <input type="text" id="node-input-command" placeholder="Command"> </div> <div class="form-row"> <label for="node-input-bot"><i class="icon-bookmark"></i> Bot</label> <input type="text" id="node-input-bot" placeholder="Bot"> </div> </script> <script type="text/x-red" data-help-name="telegram command"> <p>A telegram node that triggers the output when a specified command is received from the chat. Message is send to output 1 if it comes from an authorized user and contains the command at the beginning of the message. Message is send to output 2 if it comes from an authorized user if it does not contain the command.</p> </script> <!-- ------------------------------------------------------------------------------------------ --> <script type="text/javascript"> RED.nodes.registerType('telegram sender', { category: 'social', color: '#a6bbcf', defaults: { name: { value: "" }, bot: { value: "", type: "telegram bot", required: true } }, inputs: 1, outputs: 1, icon: "telegram.png", label: function () { return this.name || "telegram sender"; } }); </script> <script type="text/x-red" data-template-name="telegram sender"> <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-bot"><i class="icon-bookmark"></i> Bot</label> <input type="text" id="node-input-bot" placeholder="Bot"> </div> </script> <script type="text/x-red" data-help-name="telegram sender"> <p>A telegram node that sends the content to the chat. The message contains an error property if an exception occured.</p> </script> <!-- ------------------------------------------------------------------------------------------ --> <!-- ------------------------------------------------------------------------------------------ --> <script type="text/javascript"> RED.nodes.registerType('telegram reply', { category: 'social', color: '#a6bbcf', defaults: { name: { value: "" }, bot: { value: "", type: "telegram bot", required: true } }, inputs: 1, outputs: 1, icon: "telegram.png", label: function () { return this.name || "telegram reply"; } }); </script> <script type="text/x-red" data-template-name="telegram reply"> <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-bot"><i class="icon-bookmark"></i> Bot</label> <input type="text" id="node-input-bot" placeholder="Bot"> </div> </script> <script type="text/x-red" data-help-name="telegram reply"> <p>A telegram node that receives the reply for a specified message.</p> </script> <!-- ------------------------------------------------------------------------------------------ -->