# Bots

## Bot

<mark style="color:blue;">`GET`</mark> `https://discords.com/bots/api/bot/:id`

#### Path Parameters

| Name | Type    | Description                                             |
| ---- | ------- | ------------------------------------------------------- |
| id   | integer | The ID of the bot you are requesting information about. |

{% tabs %}
{% tab title="200 The website was successfully able to fetch information about the bot." %}

```
The content of this response varies.
```

{% endtab %}

{% tab title="404 The bot you requested is not listed on the website." %}

```javascript
{"message":"Bot not found."}
```

{% endtab %}
{% endtabs %}

## Votes

<mark style="color:blue;">`GET`</mark> `https://discords.com/bots/api/bot/:id/votes`

#### Path Parameters

| Name | Type    | Description                                                 |
| ---- | ------- | ----------------------------------------------------------- |
| id   | integer | The ID of the bot you are requesting voting information on. |

#### Headers

| Name          | Type   | Description                            |
| ------------- | ------ | -------------------------------------- |
| Authorization | string | The bot's API token.                   |
| Content-Type  | string | This should be set to application/json |

{% tabs %}
{% tab title="200 The website was successfully able to fetch information about the bot." %}

```
{
    "hasVoted": [],
    "hasVoted24": [],
    "votes": 0,
    "votes24": 0,
    "votesMonth": 0
}
```

{% endtab %}

{% tab title="400 You provided the wrong API token for the bot." %}

```
{"message":"Invalid authorization token."}
```

{% endtab %}

{% tab title="404 The bot you requested is not listed on the website." %}

```
{"message":"Bot not found."}
```

{% endtab %}
{% endtabs %}

## Widget

<mark style="color:blue;">`GET`</mark> `https://discords.com/bots/api/bot/:id/widget`

#### Path Parameters

| Name | Type    | Description                                          |
| ---- | ------- | ---------------------------------------------------- |
| id   | integer | The ID of the bot you are requesting information on. |

#### Query Parameters

| Name  | Type   | Description                               |
| ----- | ------ | ----------------------------------------- |
| theme | string | Set this to dark for a dark themed widget |
| width | number | Set the width of the widget               |

{% tabs %}
{% tab title="200 The website was successfully able to fetch and display the bot's widget." %}

```
The content of this response varies.
```

{% endtab %}

{% tab title="404 The bot you requested is not listed on the website." %}

```javascript
{"message":"Bot not found."}
```

{% endtab %}
{% endtabs %}

## Server Count

<mark style="color:green;">`POST`</mark> `https://discords.com/bots/api/bot/:id`

#### Path Parameters

| Name | Type    | Description                                          |
| ---- | ------- | ---------------------------------------------------- |
| id   | integer | The ID of the bot you are posting information about. |

#### Headers

| Name          | Type   | Description          |
| ------------- | ------ | -------------------- |
| Authorization | string | The bot's API token. |

#### Request Body

| Name          | Type   | Description                   |
| ------------- | ------ | ----------------------------- |
| server\_count | number | The server count for the bot. |

{% tabs %}
{% tab title="200 Server count was successfully received and updated." %}

```javascript
{ message: 'Server count successfully updated.' }
```

{% endtab %}

{% tab title="400 You may receive one of the following 400 errors depending on your situation." %}

```javascript
//You did not provide any bot token:
{ message: 'Authorization is required.' }

//You did not provide any server count:
{ message: 'Server count is required.' }

//The server count you provided was not a valid number:
{ message: 'Server count must be a valid number.' }

//The token you provided does not match the bot's token:
{ message: 'Invalid authorization token.' }
```

{% endtab %}

{% tab title="404 The bot you are trying to post information on is not listed." %}

```javascript
{ message: 'Invalid bot.' }
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.botsfordiscord.com/methods/bots.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
