feat: add support for fetching multiple instances by key

This commit adds a new feature to fetch instances by key in the InstanceController. If the provided key does not match the environment key, the controller will search for instances with the matching token. If instances are found, the names are extracted and passed to the waMonitor to retrieve instance information.

Also, update the waMonitor's instanceInfo method to accept an array of instance names instead of a single name.

Fixes #990
This commit is contained in:
Rafael Santana
2024-10-17 16:42:52 -05:00
parent ec2b7f94f8
commit ecd4b913b6
3 changed files with 25 additions and 16 deletions

View File

@@ -1699,7 +1699,7 @@ export class BaileysStartupService extends ChannelStartupService {
website: business?.website?.shift(),
};
} else {
const info: Instance = await waMonitor.instanceInfo(instanceName);
const info: Instance = await waMonitor.instanceInfo([instanceName]);
const business = await this.fetchBusinessProfile(jid);
return {