UNPKG

prisme-flow

Version:

prisme platform flow engine

152 lines (131 loc) 5.49 kB
<!-- Created by prisme.io on 09/06/2017. @author <a href="mailto:hello@prisme.io">savane vamara</a> (prisme.io) --> <script type="text/x-red" data-template-name="slack"> <div class="form-row"> <label for="node-input-channelURL"><i class="fa fa-slack"></i> WebHook URL</label> <input type="text" id="node-input-channelURL" placeholder="channelURL" style=" vertical-align: top;"> </div> <div class="form-row"> <label for="node-input-username"><i class="fa fa-user"></i> Posting UserName</label> <input type="text" id="node-input-username" placeholder="username" style=" vertical-align: top;"> </div> <div class="form-row"> <label for="node-input-emojiIcon"><i class="fa fa-smile-o"></i> Emoji Icon</label> <input type="text" id="node-input-emojiIcon" placeholder=":emojiIcon:" style=" vertical-align: top;"> </div> <div class="form-row"> <label for="node-input-channel"><i class="fa fa-random"></i> Channel</label> <input type="text" id="node-input-channel" placeholder="optional channel override"> </div> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> </script> <script type="text/x-red" data-help-name="slack"> <p>Sends the <b>msg.payload</b> to Slack.</p> <p>Simple way to post to a Slack channel.</p> <p>You can optionally override the destination channel if required - either in the edit dialogue or by setting <b>msg.channel</b>.</p> <p>You can also create <a href="https://api.slack.com/docs/attachments" target="_new">Slack attachments</a> by adding a <b>msg.attachments</b> property that must be an array.</p> </script> <script type="text/x-red" data-template-name="Slack Bot In"> <div class="form-row"> <label for="node-input-apiToken"><i class="fa fa-slack"></i>Bot API Token</label> <input type="text" id="node-input-apiToken" placeholder="apiToken" style=" vertical-align: top;"> </div> <div class="form-row"> <label for="node-input-channel"><i class="fa fa-random"></i>Channel</label> <input type="text" id="node-input-channel" placeholder="optional channel override"> </div> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i>Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> </script> <script type="text/x-red" data-help-name="Slack Bot In"> <p>Provides a listener in any channel the Slack bot is a member of.</p> <p>Outputs the <b>msg.payload</b> as the incoming message.</p> <p>Outputs <b>msg.SlackObj</b> with full Slack message details.</p> <p>You can optionally limit the channel to listen to in the edit dialogue.</p> </script> <script type="text/x-red" data-template-name="Slack Bot Out"> <div class="form-row"> <label for="node-input-apiToken"><i class="fa fa-slack"></i>Bot API Token</label> <input type="text" id="node-input-apiToken" placeholder="apiToken" style=" vertical-align: top;"> </div> <div class="form-row"> <label for="node-input-channel"><i class="fa fa-random"></i>Channel</label> <input type="text" id="node-input-channel" placeholder="optional channel override"> </div> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i>Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> </script> <script type="text/x-red" data-help-name="Slack Bot Out"> <p>Sends the <b>msg.payload</b> to Slack based on the Bot API token provided.</p> <p>You can optionally override the destination channel if required - either in the edit dialogue or by setting <b>msg.channel</b>.</p> </script> <script type="text/javascript"> RED.nodes.registerType('slack',{ category: 'social', defaults: { name: {value:""}, channelURL: {value:"", required:true}, username: {value:""}, emojiIcon: {value:""}, channel: {value:""} }, color:"#4C9689", icon: "slack.png", align: "right", inputs:1, outputs:0, label: function() { return this.name||"slack"; }, labelStyle: function() { return this.name?"node_label_italic":""; } }); RED.nodes.registerType('Slack Bot In',{ category: 'social', defaults: { name: {value:""}, apiToken: {value:"", required:true}, channel: {value:""} }, color:"#4C9689", icon: "slack.png", align: "right", inputs:0, outputs:1, label: function() { return this.name || 'slack'; }, labelStyle: function() { return this.name?"node_label_italic":""; } }); RED.nodes.registerType('Slack Bot Out',{ category: 'social', defaults: { name: {value:""}, apiToken: {value:"", required:true}, channel: {value:""} }, color:"#4C9689", icon: "slack.png", align: "right", inputs:1, outputs:0, label: function() { return this.name || 'slack'; }, labelStyle: function() { return this.name?"node_label_italic":""; } }); </script>