getAllBots
The getAllBots method retrieves all bot instances managed by the MultiBot class. This method returns an array containing all initialized Telegram bot instances.
Method getAllBots
getAllBotsUsage:
const allBots = multiBotInstance.getAllBots();Parameters:
This method does not take any parameters.
Returns:
Array.<TelegramBot>: An array of allTelegramBotinstances managed by theMultiBotclass.
Example:
const allBots = multiBotInstance.getAllBots();
allBots.forEach(bot => {
console.log(`Bot ID: ${bot.id}`);
// Perform operations with each bot instance
});Notes:
Ensure that the
MultiBotinstance has been correctly initialized with valid bot configurations before calling this method.This method is particularly useful in scenarios where you need to perform actions or retrieve information from all the bots managed by the
MultiBotinstance.
Last updated