Skip to content

Instantly share code, notes, and snippets.

@fernandovbs
Created March 23, 2023 00:01
Show Gist options
  • Save fernandovbs/ffedf412b13d2c37a4ee7dd851e50b76 to your computer and use it in GitHub Desktop.
Save fernandovbs/ffedf412b13d2c37a4ee7dd851e50b76 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
let scriptWeni = document.createElement("script");
scriptWeni.src = 'https://storage.googleapis.com/push-webchat/wwc-latest.js';
scriptWeni.async = true;
scriptWeni.onload=chatLoader;
const firstScriptFromPage = document.getElementsByTagName('script')[0];
firstScriptFromPage.parentNode.insertBefore(scriptWeni, firstScriptFromPage);
function chatLoader() {
let j = document.createElement("div");
j.id = "wwc";
document.body.appendChild(j);
let s = document.createElement("link");
s.rel = "stylesheet";
s.href = "https://weni-sp-integrations-production.s3.amazonaws.com/apptypes/wwc/16914deb-f4e4-4f53-8b3a-76a05764bf95/custom.css";
document.head.appendChild(s);
let p = {
"title": "TimmY Bot",
"inputTextFieldHint": "Digite sua mensagem...",
"showFullScreenButton": true,
"displayUnreadCount": true,
// "initPayload": "disparo ativo",
"mainColor": "#e3ddf1",
"profileAvatar": "https://weni-sp-integrations-production.s3.amazonaws.com/apptypes/wwc/16914deb-f4e4-4f53-8b3a-76a05764bf95/avatar.png",
"tooltipMessage": "Se tiver alguma dúvida, é só me chamar!",
"openLauncherImage": "https://weni-sp-integrations-production.s3.amazonaws.com/apptypes/wwc/16914deb-f4e4-4f53-8b3a-76a05764bf95/avatar.png",
"selector": "#wwc",
"customizeWidget": {
"headerBackgroundColor": "#e3ddf1",
"launcherColor": "#e3ddf1",
"userMessageBubbleColor": "#e3ddf1",
"quickRepliesFontColor": "#e3ddf1",
"quickRepliesBackgroundColor": "#e3ddf133",
"quickRepliesBorderColor": "#e3ddf1"
},
"params": {
"images": {
"dims": {
"width": 300,
"height": 200
}
},
"storage": "session"
},
"channelUuid": "d4a41023-6e40-4090-aab5-04d5fecbe0d5",
"socketUrl": "https://websocket.weni.ai",
"host": "https://flows.weni.ai"
};
p["customMessageDelay"] = message => {
return 1 * 1000;
}
WebChat.default.init(p);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment