Merge branch 'main' of https://github.com/GeneralBots/BotServer
This commit is contained in:
commit
cd0187f051
3 changed files with 16 additions and 12 deletions
|
@ -773,16 +773,18 @@ export class GBMinService {
|
|||
await min.whatsAppDirectLine.setup(true);
|
||||
} else {
|
||||
const minBoot = GBServer.globals.minBoot as any;
|
||||
min.whatsAppDirectLine = new WhatsappDirectLine(
|
||||
min,
|
||||
min.botId,
|
||||
min.instance.whatsappBotKey,
|
||||
minBoot.instance.whatsappServiceKey,
|
||||
minBoot.instance.whatsappServiceNumber,
|
||||
minBoot.instance.whatsappServiceUrl,
|
||||
group
|
||||
);
|
||||
await min.whatsAppDirectLine.setup(false);
|
||||
if (min !== minBoot) {
|
||||
min.whatsAppDirectLine = new WhatsappDirectLine(
|
||||
min,
|
||||
min.botId,
|
||||
min.instance.whatsappBotKey,
|
||||
minBoot.instance.whatsappServiceKey,
|
||||
minBoot.instance.whatsappServiceNumber,
|
||||
minBoot.instance.whatsappServiceUrl,
|
||||
group
|
||||
);
|
||||
await min.whatsAppDirectLine.setup(false);
|
||||
}
|
||||
}
|
||||
|
||||
// Setups default BOT Framework dialogs.
|
||||
|
|
|
@ -295,7 +295,9 @@ export class GBSSR {
|
|||
if (!min) {
|
||||
min = req.url === '/'
|
||||
? minBoot
|
||||
: GBServer.globals.minInstances.filter(p => p.instance.activationCode.toLowerCase() === botId.toLowerCase())[0];
|
||||
: GBServer.globals.minInstances.filter(p =>
|
||||
p.instance.activationCode ? p.instance.activationCode.toLowerCase() === botId.toLowerCase()
|
||||
: null)[0];
|
||||
}
|
||||
if (!min) {
|
||||
botId = minBoot.botId;
|
||||
|
|
|
@ -1042,7 +1042,7 @@ export class WhatsappDirectLine extends GBService {
|
|||
}
|
||||
}
|
||||
|
||||
// Detects if the welcome message is enabled.z
|
||||
// Detects if the welcome message is enabled.
|
||||
|
||||
if (process.env.WHATSAPP_WELCOME_DISABLED !== 'true') {
|
||||
// Tries to find if user wants to switch bots.
|
||||
|
|
Loading…
Add table
Reference in a new issue