> For the complete documentation index, see [llms.txt](https://docs.stefdp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stefdp.com/reference/gattinhosbot/guild-features.md).

# Guild Features

{% hint style="info" %}
**This endpoint requires an API key**. If you don't have one, you can get one by using the bot's slash command <mark style="color:purple;">`/apikey generate`</mark>
{% endhint %}

{% hint style="info" %}
**The API key owner must have the&#x20;**<mark style="color:purple;">**`Administrator`**</mark>**&#x20;permission** in the selected guild to be able to get its data
{% endhint %}

## Get the guild features

<mark style="color:blue;">`GET`</mark> `https://api.stefdp.com/gattinhosBot/guilds/{guild_id}/features/{section}/{id}`

#### Path Parameters

| Name                                        | Type   | Description                                                                                                  |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------ |
| guild\_id<mark style="color:red;">\*</mark> | String | The ID of the guild                                                                                          |
| section                                     | String | The specific section of the JSON to get. Supported values: `welcome`, `reactionRoles`, `logs`, `leveling`.   |
|                                             | String | The ID of the reaction role or the welcome message (ignored when section is bot `welcome` or `reactionRoles` |

#### Headers

| Name                                            | Type   | Description        |
| ----------------------------------------------- | ------ | ------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | `Bearer <API_KEY>` |

{% tabs %}
{% tab title="200: OK When no section is given or it's invalid" %}
Returns all the guild features

{% tabs %}
{% tab title="Body" %}

```json
{
  "logs": {
    "status": {
      "autoModerationRuleCreate": false,
      "autoModerationRuleDelete": false,
      "autoModerationRuleUpdate": false,
      "channelCreate": false,
      "channelDelete": false,
      "channelUpdate": false,
      "emojiCreate": false,
      "emojiDelete": false,
      "emojiUpdate": false,
      "guildBanAdd": false,
      "guildBanRemove": false,
      "guildMemberAdd": false,
      "guildMemberRemove": false,
      "guildMemberUpdate": false,
      "guildScheduledEventCreate": false,
      "guildScheduledEventDelete": false,
      "guildScheduledEventUpdate": false,
      "guildScheduledEventUserAdd": false,
      "guildScheduledEventUserRemove": false,
      "guildUpdate": false,
      "inviteCreate": false,
      "inviteDelete": false,
      "messageDelete": false,
      "messageDeleteBulk": false,
      "messageReactionRemoveAll": false,
      "messageReactionRemoveEmoji": false,
      "messageUpdate": false,
      "roleCreate": false,
      "roleDelete": false,
      "roleUpdate": false,
      "stageInstanceCreate": false,
      "stageInstanceDelete": false,
      "stageInstanceUpdate": false,
      "stickerCreate": false,
      "stickerDelete": false,
      "stickerUpdate": false,
      "threadCreate": false,
      "threadDelete": false,
      "threadUpdate": false,
      "userUpdate": false,
      "voiceStateUpdate": false
    },
    "webhookUrl": ""
  },
  "leveling": {
    "excludedRoles": [],
    "enabled": false,
    "excludedChannels": [],
    "excludedUsers": [],
    "xpRate": 1,
    "xpTimeout": 1000,
    "levelUpChannelId": "current",
    "levelUpMessage": "{{user}} just reached level {{user.level}}. Now he's at {{user.xp}}/{{user.xp.needed}}XP for the next level!"
  },
  "reactionRoles": [
    {
      "id": 0,
      "embedEnabled": false,
      "message": "",
      "channelId": "1142592785757774005",
      "embed": "",
      "reactionsLegend": {},
      "messageId": "1149629557964541972"
    }
  ],
  "welcomeMessages": [
    {
      "image": {
        "message": {
          "background": {
            "type": "image",
            "color": "#7d0bbf",
            "customImageURL": "/home/container/data/default_background.jpg"
          },
          "enabled": false,
          "embed": false
        },
        "embed": {
          "enabled": false,
          "imageURL": ""
        }
      },
      "id": 0,
      "embedEnabled": false,
      "embedTimestamp": false,
      "message": "",
      "channelId": "1142594747790282854",
      "embed": ""
    }
  ]
}
```

{% endtab %}

{% tab title="Headers" %}

```http
Content-Type: application/json
```

{% endtab %}

{% tab title="Schema" %}
{% code fullWidth="false" %}

```json
{
  "type": "object",
  "properties": {
    "logs": {
      "type": "object",
      "properties": {
        "status": {
          "type": "object",
          "properties": {
            "autoModerationRuleCreate": {
              "type": "boolean"
            },
            "autoModerationRuleDelete": {
              "type": "boolean"
            },
            "autoModerationRuleUpdate": {
              "type": "boolean"
            },
            "channelCreate": {
              "type": "boolean"
            },
            "channelDelete": {
              "type": "boolean"
            },
            "channelUpdate": {
              "type": "boolean"
            },
            "emojiCreate": {
              "type": "boolean"
            },
            "emojiDelete": {
              "type": "boolean"
            },
            "emojiUpdate": {
              "type": "boolean"
            },
            "guildBanAdd": {
              "type": "boolean"
            },
            "guildBanRemove": {
              "type": "boolean"
            },
            "guildMemberAdd": {
              "type": "boolean"
            },
            "guildMemberRemove": {
              "type": "boolean"
            },
            "guildMemberUpdate": {
              "type": "boolean"
            },
            "guildScheduledEventCreate": {
              "type": "boolean"
            },
            "guildScheduledEventDelete": {
              "type": "boolean"
            },
            "guildScheduledEventUpdate": {
              "type": "boolean"
            },
            "guildScheduledEventUserAdd": {
              "type": "boolean"
            },
            "guildScheduledEventUserRemove": {
              "type": "boolean"
            },
            "guildUpdate": {
              "type": "boolean"
            },
            "inviteCreate": {
              "type": "boolean"
            },
            "inviteDelete": {
              "type": "boolean"
            },
            "messageDelete": {
              "type": "boolean"
            },
            "messageDeleteBulk": {
              "type": "boolean"
            },
            "messageReactionRemoveAll": {
              "type": "boolean"
            },
            "messageReactionRemoveEmoji": {
              "type": "boolean"
            },
            "messageUpdate": {
              "type": "boolean"
            },
            "roleCreate": {
              "type": "boolean"
            },
            "roleDelete": {
              "type": "boolean"
            },
            "roleUpdate": {
              "type": "boolean"
            },
            "stageInstanceCreate": {
              "type": "boolean"
            },
            "stageInstanceDelete": {
              "type": "boolean"
            },
            "stageInstanceUpdate": {
              "type": "boolean"
            },
            "stickerCreate": {
              "type": "boolean"
            },
            "stickerDelete": {
              "type": "boolean"
            },
            "stickerUpdate": {
              "type": "boolean"
            },
            "threadCreate": {
              "type": "boolean"
            },
            "threadDelete": {
              "type": "boolean"
            },
            "threadUpdate": {
              "type": "boolean"
            },
            "userUpdate": {
              "type": "boolean"
            },
            "voiceStateUpdate": {
              "type": "boolean"
            }
          },
          "description": "Contains the data about ehich logs are enabled or disabled"
        },
        "webhookUrl": {
          "type": "string"
        }
      },
      "description": "Contains the data about which logs are enabled or disabled, the ID of the logs channel and webhook URL where it sends the logs"
    },
    "leveling": {
      "type": "object",
      "properties": {
        "excludedRoles": {
          "type": "array",
          "description": "Contains the IDs of the excluded roles"
        },
        "enabled": {
          "type": "boolean",
          "description": "Whether leveling is enabled or disabled"
        },
        "excludedChannels": {
          "type": "array",
          "description": "Contains the IDs of the excluded channels"
        },
        "excludedUsers": {
          "type": "array",
          "description": "Contains the IDs of the excluded users"
        },
        "xpRate": {
          "type": "number",
          "description": "The XP rate of the guild"
        },
        "xpTimeout": {
          "type": "number",
          "description": "The XP timeout of the guild in ms"
        },
        "levelUpChannelId": {
          "type": "string",
          "description": "The ID of ther chsnnel where the bot will send the level up message (\"current if it will send it where the message was sent\")"
        },
        "levelUpMessage": {
          "type": "string",
          "description": "The level up message"
        }
      }
    },
    "reactionRoles": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "The ID of the reaction role"
          },
          "embedEnabled": {
            "type": "boolean",
            "description": "Whether the reaction role has an embed"
          },
          "message": {
            "type": "string"
          },
          "channelId": {
            "type": "string",
            "description": "The ID of the channel where the reaction role is set"
          },
          "embed": {
            "type": "string"
          },
          "reactionsLegend": {
            "type": "object",
            "description": "The legend mapping reaction emojis (both unicode and custom) to role IDs (emoji: role_id)"
          },
          "messageId": {
            "type": "string",
            "description": "The ID of the message associated with the reaction role."
          }
        }
      },
      "description": "Contains the objects of the reaction roles in the guild"
    },
    "welcomeMessages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "image": {
            "type": "object",
            "properties": {
              "message": {
                "type": "object",
                "properties": {
                  "background": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "The type of the background. Can be `color` (HEX) or `image` (URL/path)"
                      },
                      "color": {
                        "type": "string",
                        "description": "the color of the background (used only if `type` is set to `color`)"
                      },
                      "customImageURL": {
                        "type": "string",
                        "description": "The URL of the custom image (used only if `type` is `image`). The default image is a path instead of an URL"
                      }
                    },
                    "description": "Data about the background of the image for the image with the user info"
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "Whether the image with the user info is enabled"
                  },
                  "embed": {
                    "type": "boolean",
                    "description": "Whether the image with the user info is inside the embed"
                  }
                },
                "description": "+ Data about the image with the user info"
              },
              "embed": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": "Whether the embed has a custom image"
                  },
                  "imageURL": {
                    "type": "string"
                  }
                },
                "description": "Data about the image of the embed"
              }
            },
            "description": "Data about the welcome message images"
          },
          "id": {
            "type": "number",
            "description": "The ID of the welcome message"
          },
          "embedEnabled": {
            "type": "boolean",
            "description": "Whether the welcome message has an embed"
          },
          "embedTimestamp": {
            "type": "boolean",
            "description": "Whether the embed shows the timestamp"
          },
          "message": {
            "type": "string"
          },
          "channelId": {
            "type": "string",
            "description": "The channel where the welcome message is sent"
          },
          "embed": {
            "type": "string"
          }
        }
      },
      "description": "Contains the objects of the welcome messages in the guild"
    }
  }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="200: OK When the section is logs" %}
Returns an object with the data about the `logs` settings in the guild

{% tabs %}
{% tab title="Body" %}

```json
{
  "status": {
    "autoModerationRuleCreate": false,
    "autoModerationRuleDelete": false,
    "autoModerationRuleUpdate": false,
    "channelCreate": false,
    "channelDelete": false,
    "channelUpdate": false,
    "emojiCreate": false,
    "emojiDelete": false,
    "emojiUpdate": false,
    "guildBanAdd": false,
    "guildBanRemove": false,
    "guildMemberAdd": false,
    "guildMemberRemove": false,
    "guildMemberUpdate": false,
    "guildScheduledEventCreate": false,
    "guildScheduledEventDelete": false,
    "guildScheduledEventUpdate": false,
    "guildScheduledEventUserAdd": false,
    "guildScheduledEventUserRemove": false,
    "guildUpdate": false,
    "inviteCreate": false,
    "inviteDelete": false,
    "messageDelete": false,
    "messageDeleteBulk": false,
    "messageReactionRemoveAll": false,
    "messageReactionRemoveEmoji": false,
    "messageUpdate": false,
    "roleCreate": false,
    "roleDelete": false,
    "roleUpdate": false,
    "stageInstanceCreate": false,
    "stageInstanceDelete": false,
    "stageInstanceUpdate": false,
    "stickerCreate": false,
    "stickerDelete": false,
    "stickerUpdate": false,
    "threadCreate": false,
    "threadDelete": false,
    "threadUpdate": false,
    "userUpdate": false,
    "voiceStateUpdate": false
  },
  "webhookUrl": ""
}
```

{% endtab %}

{% tab title="Headers" %}

```http
Content-Type: application/json
```

{% endtab %}

{% tab title="Schema" %}

```json
{
  "type": "object",
  "properties": {
    "status": {
      "type": "object",
      "properties": {
        "autoModerationRuleCreate": {
          "type": "boolean"
        },
        "autoModerationRuleDelete": {
          "type": "boolean"
        },
        "autoModerationRuleUpdate": {
          "type": "boolean"
        },
        "channelCreate": {
          "type": "boolean"
        },
        "channelDelete": {
          "type": "boolean"
        },
        "channelUpdate": {
          "type": "boolean"
        },
        "emojiCreate": {
          "type": "boolean"
        },
        "emojiDelete": {
          "type": "boolean"
        },
        "emojiUpdate": {
          "type": "boolean"
        },
        "guildBanAdd": {
          "type": "boolean"
        },
        "guildBanRemove": {
          "type": "boolean"
        },
        "guildMemberAdd": {
          "type": "boolean"
        },
        "guildMemberRemove": {
          "type": "boolean"
        },
        "guildMemberUpdate": {
          "type": "boolean"
        },
        "guildScheduledEventCreate": {
          "type": "boolean"
        },
        "guildScheduledEventDelete": {
          "type": "boolean"
        },
        "guildScheduledEventUpdate": {
          "type": "boolean"
        },
        "guildScheduledEventUserAdd": {
          "type": "boolean"
        },
        "guildScheduledEventUserRemove": {
          "type": "boolean"
        },
        "guildUpdate": {
          "type": "boolean"
        },
        "inviteCreate": {
          "type": "boolean"
        },
        "inviteDelete": {
          "type": "boolean"
        },
        "messageDelete": {
          "type": "boolean"
        },
        "messageDeleteBulk": {
          "type": "boolean"
        },
        "messageReactionRemoveAll": {
          "type": "boolean"
        },
        "messageReactionRemoveEmoji": {
          "type": "boolean"
        },
        "messageUpdate": {
          "type": "boolean"
        },
        "roleCreate": {
          "type": "boolean"
        },
        "roleDelete": {
          "type": "boolean"
        },
        "roleUpdate": {
          "type": "boolean"
        },
        "stageInstanceCreate": {
          "type": "boolean"
        },
        "stageInstanceDelete": {
          "type": "boolean"
        },
        "stageInstanceUpdate": {
          "type": "boolean"
        },
        "stickerCreate": {
          "type": "boolean"
        },
        "stickerDelete": {
          "type": "boolean"
        },
        "stickerUpdate": {
          "type": "boolean"
        },
        "threadCreate": {
          "type": "boolean"
        },
        "threadDelete": {
          "type": "boolean"
        },
        "threadUpdate": {
          "type": "boolean"
        },
        "userUpdate": {
          "type": "boolean"
        },
        "voiceStateUpdate": {
          "type": "boolean"
        }
      },
      "description": "Contains the data about ehich logs are enabled or disabled"
    },
    "webhookUrl": {
      "type": "string"
    }
  }
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="200: OK When the section is leveling" %}
Returns an object with the data about the leveling settings in the guild

{% tabs %}
{% tab title="Body" %}

```json
{
  "excludedRoles": [],
  "enabled": false,
  "excludedChannels": [],
  "excludedUsers": [],
  "xpRate": 1,
  "xpTimeout": 1000,
  "levelUpChannelId": "current",
  "levelUpMessage": "{{user}} just reached level {{user.level}}. Now he's at {{user.xp}}/{{user.xp.needed}}XP for the next level!"
}
```

{% endtab %}

{% tab title="Headers" %}

```http
Content-Type: application/json
```

{% endtab %}

{% tab title="Schema" %}

```json
{
  "type": "object",
  "properties": {
    "excludedRoles": {
      "type": "array",
      "description": "Contains the IDs of the excluded roles"
    },
    "enabled": {
      "type": "boolean",
      "description": "Whether leveling is enabled or disabled"
    },
    "excludedChannels": {
      "type": "array",
      "description": "Contains the IDs of the excluded channels"
    },
    "excludedUsers": {
      "type": "array",
      "description": "Contains the IDs of the excluded users"
    },
    "xpRate": {
      "type": "number",
      "description": "The XP rate of the guild"
    },
    "xpTimeout": {
      "type": "number",
      "description": "The XP timeout of the guild in ms"
    },
    "levelUpChannelId": {
      "type": "string",
      "description": "The ID of ther chsnnel where the bot will send the level up message (\"current if it will send it where the message was sent\")"
    },
    "levelUpMessage": {
      "type": "string",
      "description": "The level up message"
    }
  }
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="200: OK When the section is reactionRoles" %}
Returns an array with the objects of each reaction role in the guild

{% tabs %}
{% tab title="Body" %}

```json
[
  {
    "id": 0,
    "embedEnabled": false,
    "message": "",
    "channelId": "1142592785757774005",
    "embed": "",
    "reactionsLegend": {},
    "messageId": "1149629557964541972"
  }
]
```

{% endtab %}

{% tab title="Headers" %}

```http
Content-Type: application/json
```

{% endtab %}

{% tab title="Schema" %}

```json
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "number",
        "description": "The ID of the reaction role"
      },
      "embedEnabled": {
        "type": "boolean",
        "description": "Whether the reaction role has an embed"
      },
      "message": {
        "type": "string"
      },
      "channelId": {
        "type": "string",
        "description": "The ID of the channel where the reaction role is set"
      },
      "embed": {
        "type": "string"
      },
      "reactionsLegend": {
        "type": "object",
        "description": "The legend mapping reaction emojis (both unicode and custom) to role IDs (emoji: role_id)"
      },
      "messageId": {
        "type": "string",
        "description": "The ID of the message associated with the reaction role."
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="200: OK When the section is welcome" %}
Returns an array with the objects of each welcome message in the guild

{% tabs %}
{% tab title="Body" %}

```json
[
  {
    "image": {
      "message": {
        "background": {
          "type": "image",
          "color": "#7d0bbf",
          "customImageURL": "/home/container/data/default_background.jpg"
        },
        "enabled": false,
        "embed": false
      },
      "embed": {
        "enabled": false,
        "imageURL": ""
      }
    },
    "id": 0,
    "embedEnabled": false,
    "embedTimestamp": false,
    "message": "",
    "channelId": "1142594747790282854",
    "embed": ""
  }
]
```

{% endtab %}

{% tab title="Headers" %}

```http
Content-Type: application/json
```

{% endtab %}

{% tab title="Schema" %}

```json
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "image": {
        "type": "object",
        "properties": {
          "message": {
            "type": "object",
            "properties": {
              "background": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "The type of the background. Can be `color` (HEX) or `image` (URL/path)"
                  },
                  "color": {
                    "type": "string",
                    "description": "the color of the background (used only if `type` is set to `color`)"
                  },
                  "customImageURL": {
                    "type": "string",
                    "description": "The URL of the custom image (used only if `type` is `image`). The default image is a path instead of an URL"
                  }
                },
                "description": "Data about the background of the image for the image with the user info"
              },
              "enabled": {
                "type": "boolean",
                "description": "Whether the image with the user info is enabled"
              },
              "embed": {
                "type": "boolean",
                "description": "Whether the image with the user info is inside the embed"
              }
            },
            "description": "Data about the image with the user info"
          },
          "embed": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "Whether the embed has a custom image"
              },
              "imageURL": {
                "type": "string"
              }
            },
            "description": "Data about the image of the embed"
          }
        },
        "description": "Data about the welcome message images"
      },
      "id": {
        "type": "number",
        "description": "The ID of the welcome message"
      },
      "embedEnabled": {
        "type": "boolean",
        "description": "Whether the welcome message has an embed"
      },
      "embedTimestamp": {
        "type": "boolean",
        "description": "Whether the embed shows the timestamp"
      },
      "message": {
        "type": "string"
      },
      "channelId": {
        "type": "string",
        "description": "The channel where the welcome message is sent"
      },
      "embed": {
        "type": "string"
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="401: Unauthorized The API key is not valid" %}
{% tabs %}
{% tab title="Body" %}

```json
{
    "code": 401,
    "message": "Unauthorized"
}
```

{% endtab %}

{% tab title="Headers" %}

```http
Content-Type: application/json
```

{% endtab %}

{% tab title="Schema" %}

```json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "The code of the error"
    },
    "message": {
      "type": "string",
      "description": "A description of the error"
    }
  }
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="403: Forbidden The user has been banned" %}
{% tabs %}
{% tab title="Body" %}

```json
{
    "code": 1000,
    "message": "The owner of this key is banned from the bot"
}
```

{% endtab %}

{% tab title="Headers" %}

```http
Content-Type: application/json
```

{% endtab %}

{% tab title="Schema" %}

```json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "The code of the error"
    },
    "message": {
      "type": "string",
      "description": "A description of the error"
    }
  }
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="403: Forbidden The guild has been banned" %}
{% tabs %}
{% tab title="Body" %}

```json
{
    "code": 1001,
    "message": "The guild is banned from the bot"
}
```

{% endtab %}

{% tab title="Headers" %}

```http
Content-Type: application/json
```

{% endtab %}

{% tab title="Schema" %}

```json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "The code of the error"
    },
    "message": {
      "type": "string",
      "description": "A description of the error"
    }
  }
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="404: Not Found The guild is not present in the bot's database" %}
{% tabs %}
{% tab title="Body" %}

<pre class="language-json"><code class="lang-json"><strong>{
</strong><strong>    "code": 404,
</strong>    "message": "Not Found"
}
</code></pre>

{% endtab %}

{% tab title="Headers" %}

```http
Content-Type: application/json
```

{% endtab %}

{% tab title="Schema" %}

```json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "The code of the error"
    },
    "message": {
      "type": "string",
      "description": "A description of the error"
    }
  }
}
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

## Examples

{% tabs %}
{% tab title="cURL" %}

```sh
curl 'https://api.stefdp.com/gattinhosBot/guilds/940249530962706492/features'
    -H 'Authorization: Bearer <API_KEY>'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
fetch('https://api.stefdp.com/gattinhosBot/guilds/940249530962706492/features', {
    headers: {
        'Authorization': 'Bearer <API_KEY>'
    }
})
```

### Try it out!

{% @runkit/embed content="const guild\_id = 'YOUR\_GUILD\_ID'
const api\_key = 'YOUR\_API\_KEY'

fetch(`https://api.stefdp.is-a.dev/gattinhosBot/guilds/${guild_id}/features`, {
headers: {
'Authorization': `Bearer ${api_key}`
}
}).then(res => res.json()).then(console.log)" nodeVersion="18.x.x" %}
{% endtab %}
{% endtabs %}
