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

Usage:

const allBots = multiBotInstance.getAllBots();

Parameters:

  • This method does not take any parameters.

Returns:

  • Array.<TelegramBot>: An array of all TelegramBot instances managed by the MultiBot class.

Example:

const allBots = multiBotInstance.getAllBots();
allBots.forEach(bot => {
    console.log(`Bot ID: ${bot.id}`);
    // Perform operations with each bot instance
});

Notes:

  • Ensure that the MultiBot instance 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 MultiBot instance.

Last updated