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
158 lines (146 loc) • 4.52 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('chatbot-smooch-node', {
category: 'config',
defaults: {
botname: {
value: '',
required: true
},
usernames: {
value: '',
required: false
},
log: {
value: null
}
},
paletteName: 'Smooch Bot',
credentials: {
keyId: {
type: 'text'
},
secret: {
type: 'text'
}
},
label: function () {
return this.botname;
}
});
</script>
<script type="text/x-red" data-template-name="chatbot-smooch-node">
<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-keyId"><i class="icon-cog"></i> Key Id</label>
<input type="text" id="node-config-input-keyId" placeholder="Key Id">
<div style="max-width: 460px;font-size: 12px;color: #999999;line-height: 14px;margin-top:5px;">
In Smooch <i>"Settings"</i> create a secret key (a pair <strong>Key id</strong> and <strong>Secret</strong>)
</div>
</div>
<div class="form-row">
<label for="node-config-input-secret"><i class="icon-cog"></i> App Secret</label>
<input type="text" id="node-config-input-secret" placeholder="Secret">
</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" placeholder="Authorized users">
<div style="max-width: 460px;font-size: 12px;color: #999999;line-height: 14px;margin-top:5px;">
Comma separated list of userId authorized to use the chatBot
</div>
</div>
<div class="form-row">
<label for="node-config-input-log"><i class="icon-file"></i> Log file</label>
<input type="text" id="node-config-input-log">
<div style="max-width: 460px;font-size: 12px;color: #999999;line-height: 14px;margin-top:5px;">
Store inbound and outbound messages to file
</div>
</div>
</script>
<script type="text/x-red" data-help-name="chatbot-smooch-node">
<p>
Configure the Smooch chat bot
</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('chatbot-smooch-receive', {
category: 'RedBot Platforms',
color: '#FFCC66',
defaults: {
bot: {
value: '',
type: 'chatbot-smooch-node',
required: true
}
},
inputs: 0,
outputs: 1,
icon: 'chatbot-receiver.png',
paletteLabel: 'Smooch In',
label: function () {
return "Smooch Receiver";
}
});
</script>
<script type="text/x-red" data-template-name="chatbot-smooch-receive">
<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="chatbot-smooch-receive">
<p>
Receive a message (text, image, etc) from a Smooch service. Smooch allows integrations with many platform including
a generic web widget.
</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('chatbot-smooch-send', {
category: 'RedBot Platforms',
color: '#FFCC66',
defaults: {
bot: {
value: "",
type: 'chatbot-smooch-node',
required: true
},
track: {
value: false
},
outputs: {
value: 0
}
},
inputs: 1,
outputs: 0,
icon: 'chatbot-sender.png',
paletteLabel: 'Smooch Out',
label: function () {
return "Smooch Sender";
},
oneditsave: function() {
var track = $('#node-input-track').is(':checked');
this.outputs = track ? 1 : 0;
}
});
</script>
<script type="text/x-red" data-template-name="chatbot-smooch-send">
<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-track"><i class="icon-envelope"></i> Track</label>
<input type="checkbox" value="true" id="node-input-track">
<div style="max-width: 460px;font-size: 12px;color: #999999;line-height: 14px;margin-top:5px;">
Track response of the user for this message, any further answer will be redirect to the output pin.
</div>
</div>
</script>
<script type="text/x-red" data-help-name="chatbot-smooch-send">
<p>
Smooch
</p>
</script>