fix(all): Templates OK.
This commit is contained in:
parent
b9dbf11f61
commit
110083e1c1
4 changed files with 34 additions and 14 deletions
|
@ -453,7 +453,7 @@ export class GBMinService {
|
|||
.all(`/${min.instance.botId}/whatsapp`, async (req, res) => {
|
||||
if (req.query['hub.mode'] === 'subscribe') {
|
||||
const val = req.query['hub.verify_token'];
|
||||
const challenge = min.core.getParam<string>(min.instance, `Meta Challenge`, null);
|
||||
const challenge = (min.core['getParam'] as any)(min.instance, `Meta Challenge`, null, true);
|
||||
|
||||
if (challenge && val === challenge) {
|
||||
res.send(req.query['hub.challenge']);
|
||||
|
@ -1086,7 +1086,9 @@ export class GBMinService {
|
|||
}
|
||||
|
||||
let pid = step.context.activity['pid'];
|
||||
if (!pid) {
|
||||
let recipient = context.activity?.recipient?.id;
|
||||
|
||||
if (!pid && recipient !== min.botId) {
|
||||
pid = GBVMService.createProcessInfo(user, min, step.context.activity.channelId, null, step);
|
||||
}
|
||||
step.context.activity['pid'] = pid;
|
||||
|
@ -1151,7 +1153,8 @@ export class GBMinService {
|
|||
|
||||
if (context.activity.type === 'installationUpdate') {
|
||||
GBLogEx.info(min, `Bot installed on Teams.`);
|
||||
} else if (context.activity.type === 'conversationUpdate' && context.activity.membersAdded.length > 0) {
|
||||
} else if (context.activity.type === 'conversationUpdate' &&
|
||||
context.activity.membersAdded.length > 0) {
|
||||
// Check if a bot or a human participant is being added to the conversation.
|
||||
|
||||
const member = context.activity.membersAdded[0];
|
||||
|
|
|
@ -123,7 +123,7 @@ export class WhatsappDirectLine extends GBService {
|
|||
|
||||
switch (this.provider) {
|
||||
case 'meta':
|
||||
this.botNumber = this.min.core.getParam<string>(this.min.instance, 'Bot Number', null);
|
||||
this.botNumber = (this.min.core['getParam'] as any)(this.min.instance, 'Bot Number', null, true);
|
||||
let whatsappServiceNumber, whatsappServiceKey, url;
|
||||
if (this.botNumber && this.min.instance.whatsappServiceNumber) {
|
||||
whatsappServiceNumber = this.min.instance.whatsappServiceNumber;
|
||||
|
@ -529,8 +529,22 @@ export class WhatsappDirectLine extends GBService {
|
|||
}
|
||||
} else if (user.agentMode === 'bot' || user.agentMode === null || user.agentMode === undefined) {
|
||||
if (WhatsappDirectLine.conversationIds[botId + from + group] === undefined) {
|
||||
GBLogEx.info(this.min, `GBWhatsapp: Starting new conversation on Bot.`);
|
||||
const response = await client.apis.Conversations.Conversations_StartConversation();
|
||||
const pid = GBVMService.createProcessInfo(user, this.min, 'whatsapp', null);
|
||||
GBLogEx.info(this.min, `GBWhatsapp: Starting new conversation on Bot (pid: ${pid}).`);
|
||||
let response;
|
||||
if (GBConfigService.get('STORAGE_NAME')) {
|
||||
response = await client.apis.Conversations.Conversations_StartConversation(
|
||||
|
||||
);
|
||||
} else {
|
||||
response = await client.apis.Conversations.Conversations_StartConversation(
|
||||
{
|
||||
userSystemId: user.userSystemId,
|
||||
userName: user.userName,
|
||||
pid: pid
|
||||
}
|
||||
);
|
||||
}
|
||||
const generatedConversationId = response.obj.conversationId;
|
||||
|
||||
WhatsappDirectLine.conversationIds[botId + from + group] = generatedConversationId;
|
||||
|
|
3
templates/default.gbai/default.gbdialog/hello.bas
Normal file
3
templates/default.gbai/default.gbdialog/hello.bas
Normal file
|
@ -0,0 +1,3 @@
|
|||
TALK "Hello, what is your name?"
|
||||
HEAR name
|
||||
TALK "Hi, " + name + "."
|
|
@ -1,5 +1,5 @@
|
|||
name,value
|
||||
Answer Mode,chart
|
||||
Answer Mode,sql
|
||||
llm File,northwind.db
|
||||
llm Driver,sqlite
|
||||
Theme Color,red
|
|
Loading…
Add table
Reference in a new issue