getBotById
The getBotById method retrieves a bot instance based on its unique ID. This method is applicable only for configurations of type "multi".
Method getBotById
getBotById
Usage:
Parameters:
id
(number
): The unique ID of the bot you want to retrieve.
Returns:
{TelegramBot|undefined}
: Returns the Telegram bot instance if found, orundefined
if no bot with the specified ID exists.
Example:
Notes:
This method is only available for configurations where
type
is "multi". If the type is "one", this method will not function as intended.Ensure that the bot ID is valid and that the bot has been initialized.
The method relies on the global manager's state, so make sure bots are properly loaded and managed.
Last updated