- FIX: AskDialog compilation error.
- FIX: More Whatsapp line adjustments: Duplicated 'Hi!' & log enrichment.
This commit is contained in:
parent
3cc0b5e7b4
commit
b49d5aafd6
8 changed files with 45 additions and 18 deletions
|
@ -1,3 +1,10 @@
|
|||
# Release History
|
||||
|
||||
## Version 0.0.24
|
||||
|
||||
- FIX: AskDialog compilation error.
|
||||
- FIX: More Whatsapp line adjustments: Duplicated 'Hi!' & log enrichment.
|
||||
|
||||
## Version 0.0.23
|
||||
|
||||
- FIX: Duplicated asking on main loop removed.
|
||||
|
|
|
@ -56,7 +56,8 @@ export class WelcomeDialog extends IGBDialog {
|
|||
session.endDialog(msgs);
|
||||
}
|
||||
|
||||
if (session.message) {
|
||||
|
||||
if (session.message && session.message.text != "") {
|
||||
session.replaceDialog("/answer", { query: session.message.text });
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -110,6 +110,7 @@ export class GBConversationalService implements IGBConversationalService {
|
|||
logger.trace("error: intent: [" + intent + "] error: [" + error + "]");
|
||||
session.sendTyping();
|
||||
session.send("Desculpe-me, não encontrei nada a respeito...");
|
||||
session.replaceDialog("/ask", {isReturning: true});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -117,6 +118,7 @@ export class GBConversationalService implements IGBConversationalService {
|
|||
} else {
|
||||
session.sendTyping();
|
||||
session.send("Lamento, não achei nada a respeito...");
|
||||
session.replaceDialog("/ask", {isReturning: true});
|
||||
cb(null, null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,11 +107,16 @@ export class GBCoreService implements IGBCoreService {
|
|||
}
|
||||
|
||||
syncDatabaseStructure(cb) {
|
||||
logger.trace("Syncing database...");
|
||||
this.sequelize.sync().then(value => {
|
||||
logger.trace("Database synced.");
|
||||
cb();
|
||||
});
|
||||
if (GBConfigService.get("DATABASE_SYNC")) {
|
||||
logger.trace("Syncing database...");
|
||||
this.sequelize.sync().then(value => {
|
||||
logger.trace("Database synced.");
|
||||
cb();
|
||||
});
|
||||
}
|
||||
else{
|
||||
logger.trace("Database synchronization is disabled.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -246,20 +246,24 @@ export class GBMinService {
|
|||
},
|
||||
receive: function (event: any, next) {
|
||||
logger.trace(
|
||||
`Event RCV: (Type: ${event.type}, Name: ${event.name}, Value: ${
|
||||
event.value
|
||||
}).`
|
||||
`[RCV]: ChannelID: ${event.address.channelId}, ConversationID: ${event.address.conversation.id}
|
||||
Type: ${event.type}, Name: ${event.name}, Text: ${event.text}.`
|
||||
);
|
||||
|
||||
// PACKAGE: Provide loop here.
|
||||
|
||||
if (
|
||||
event.type === "conversationUpdate" &&
|
||||
event.membersAdded.length > 0 &&
|
||||
event.membersAdded[0].name != "You"
|
||||
event.membersAdded.length > 0
|
||||
// TODO: Is it really Necessary? !event.membersAdded[0].id.startsWith('general-bot-9672a8d3') //DEMO: min.botId) //TODO: Check entire collection.
|
||||
) {
|
||||
|
||||
min.bot.beginDialog(event.address, "/");
|
||||
if (event.address.channelId != "directline") {
|
||||
min.bot.beginDialog(event.address, "/");
|
||||
}
|
||||
else {
|
||||
next();
|
||||
}
|
||||
} else if (event.name === "whoAmI") {
|
||||
min.bot.beginDialog(event.address, "/whoAmI");
|
||||
} else if (event.name === "showSubjects") {
|
||||
|
@ -284,6 +288,9 @@ export class GBMinService {
|
|||
}
|
||||
},
|
||||
send: function (event, next) {
|
||||
logger.trace(
|
||||
`[SND]: ChannelID: ${event.address.channelId}, ConversationID: ${event.address.conversation},
|
||||
Type: ${event.type} `);
|
||||
this.core.createMessage(
|
||||
this.min.conversation,
|
||||
this.min.conversation.startedBy,
|
||||
|
|
|
@ -47,6 +47,7 @@ export class AskDialog extends IGBDialog {
|
|||
|
||||
bot.dialog("/answer", [
|
||||
(session, args) => {
|
||||
|
||||
let text = "";
|
||||
|
||||
if (args && args.query) {
|
||||
|
|
|
@ -118,6 +118,7 @@ export class KBService {
|
|||
|
||||
// Builds search query.
|
||||
|
||||
what = what.toLowerCase();
|
||||
what = what.replace("?", " ");
|
||||
what = what.replace("!", " ");
|
||||
what = what.replace(".", " ");
|
||||
|
@ -125,9 +126,12 @@ export class KBService {
|
|||
what = what.replace("\\", " ");
|
||||
|
||||
if (subjects) {
|
||||
what = `${what} ${KBService.getSubjectItemsSeparatedBySpaces(
|
||||
let text = KBService.getSubjectItemsSeparatedBySpaces(
|
||||
subjects
|
||||
)}`;
|
||||
);
|
||||
if (text){
|
||||
what = `${what} ${text}`;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Filter by instance. what = `${what}&$filter=instanceId eq ${instanceId}`;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "botserver",
|
||||
"version": "0.0.23",
|
||||
"version": "0.0.24",
|
||||
"description": "General Bot Community Edition open-core server.",
|
||||
"contributors": [
|
||||
"Rodrigo Rodriguez <me@rodrigorodriguez.com>"
|
||||
|
|
Loading…
Add table
Reference in a new issue