> For the complete documentation index, see [llms.txt](https://fozan.gitbook.io/multibot-telegram/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fozan.gitbook.io/multibot-telegram/methods/getallbots.md).

# 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:**

```javascript
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:**

```javascript
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.
