Methods
getBotById(id) Retrieves a bot instance based on its unique ID. This method is applicable only for configurations of type "multi".
Parameters:
id
(number): The unique ID of the bot you want to retrieve.
Returns:
{TelegramBot|undefined}
: Returns the Telegram bot instance if found, or undefined if no bot with the specified ID exists.
getMainBot() Retrieves the main bot instance. This method finds the bot with the
main: true
property from the configuration and returns it. This method is applicable only for configurations of type "one".Returns:
{TelegramBot|undefined}
: Returns the main bot instance if found, or undefined if no main bot is configured.
getAllBots() Retrieves all bot instances. This method returns an array of all initialized Telegram bot instances. It is applicable for configurations of both types "one" and "multi".
Returns:
{Array.<TelegramBot>}
: Returns an array of all Telegram bot instances.
Last updated