Ajustes para corrigir o problema de inicialização do class, além de preparar a aplicação para funcionar com o Whatsapp.
This commit is contained in:
parent
91e03a1a39
commit
2577f47504
4 changed files with 6 additions and 5 deletions
|
@ -141,7 +141,7 @@ export class GBMinService {
|
|||
|
||||
let options = {
|
||||
url:
|
||||
"https://westus.api.cognitive.microsoft.com/sts/v1.0/issueToken",
|
||||
"https://api.cognitive.microsoft.com/sts/v1.0/issueToken",
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Ocp-Apim-Subscription-Key": instance.speechKey
|
||||
|
@ -191,9 +191,9 @@ export class GBMinService {
|
|||
GBKBPackage, GBCustomerSatisfactionPackage, GBWhatsappPackage].forEach(sysPackage => {
|
||||
logger.trace(`Loading sys package: ${sysPackage.name}...`);
|
||||
let p = Object.create(sysPackage.prototype) as IGBPackage;
|
||||
p.loadBot(min);
|
||||
e.sysPackages.push(p);
|
||||
//e.sysPackages.push(p);
|
||||
if (sysPackage.name === "GBWhatsappPackage") {
|
||||
p.loadBot(min);
|
||||
let url = "/instances/:botId/whatsapp";
|
||||
server.post(url, (req, res) => {
|
||||
p["channel"].received(req, res);
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
</head>
|
||||
|
||||
<body style="background-color: lightgrey;">
|
||||
<div id="root" class="loader"></div>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
|
||||
|
||||
|
|
|
@ -204,7 +204,7 @@ export class WhatsappDirectLine extends GBService {
|
|||
|
||||
// Ignore own messages.
|
||||
// TODO: this.botId instead of "general-bot-9672a8d3"
|
||||
activities = activities.filter((m) => { return m.from.id === "general-bot-9672a8d3" && m.type === "message" });
|
||||
activities = activities.filter((m) => { return (m.from.id === "GeneralBot-Netshoes" || m.from.id.includes("4vqtLx3cFJgBAELkRib2K8")) && m.type === "message" });
|
||||
|
||||
if (activities.length) {
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"declaration": false,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"keyofStringsOnly": true,
|
||||
"mapRoot": "./dist/",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
|
|
Loading…
Add table
Reference in a new issue