This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tls = require('tls'); | |
const https = require('https'); | |
const crypto = require('crypto'); | |
function sha256(s) { | |
return crypto.createHash('sha256').update(s).digest('base64'); | |
} | |
const options = { | |
hostname: 'qaenterprise.botlers.io', | |
port: 443, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getContrastFontColor () { | |
if(this.colorSelected.length == 7) { | |
let r = parseInt(this.colorSelected.substr(1,2),16); | |
let g = parseInt(this.colorSelected.substr(3,2),16); | |
let b = parseInt(this.colorSelected.substr(5,2),16); | |
r *= 0.299; | |
g *= 0.587; | |
b *= 0.114; | |
if((r + g + b) > 186) | |
return '#000000'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by montoya on 6/4/17. | |
*/ | |
var a6Bot = new A6BotResponseTemplate(process.env.FACEBOOK_PAGE_ID); | |
var recipientID = 1234567890; | |
//SEND MESSAGE | |
a6Bot.message('Hello world!', recipientID); | |
//SEND MULTIPLE MESSAGES |