---
url: https://docs.juniper.bot/en/message-templates/types/discord/guild.md
description: Discord Guild data type used in JuniperBot Template Engine.
---

[Number]: /en/message-templates/types/index#literals

[String]: /en/message-templates/types/index#literals

[Boolean]: /en/message-templates/types/index#literals

[List]: /en/message-templates/types/index#lists

[Map]: /en/message-templates/types/index#maps

[DateTime]: /en/message-templates/types/index#datetime

[TwitchChannel]: /en/message-templates/types/subscriptions/twitch#twitch-channel

[TwitchStream]: /en/message-templates/types/subscriptions/twitch#twitch-stream

[TwitchGame]: /en/message-templates/types/subscriptions/twitch#twitch-game

[YouTubeChannel]: /en/message-templates/types/subscriptions/youtube#youtube-channel

[YouTubeVideo]: /en/message-templates/types/subscriptions/youtube#youtube-video

[VkWallPost]: /en/message-templates/types/subscriptions/vk#vkwallpost

[Rank]: /en/message-templates/types/discord/rank

[Guild]: /en/message-templates/types/discord/guild

[Member]: /en/message-templates/types/discord/member

[Role]: /en/message-templates/types/discord/role

[Message]: /en/message-templates/types/discord/message

[Attachment]: /en/message-templates/types/discord/attachment

[Embed]: /en/message-templates/types/discord/embed

[Activity]: /en/message-templates/types/discord/activity

[MemberVoiceState]: /en/message-templates/types/discord/member-voice-state

[MemberPrimaryGuild]: /en/message-templates/types/discord/member-primary-guild

[MenuBuilder]: /en/message-templates/types/discord/menu-builder

[UserFlag]: /en/message-templates/types/discord/user-flag

[Permission]: /en/message-templates/types/discord/permission

[Category]: /en/message-templates/types/discord/category

[TextChannel]: /en/message-templates/types/discord/text-channel

[VoiceChannel]: /en/message-templates/types/discord/voice-channel

[NewsChannel]: /en/message-templates/types/discord/news-channel

[StageChannel]: /en/message-templates/types/discord/stage-channel

[ForumChannel]: /en/message-templates/types/discord/forum-channel

[MediaChannel]: /en/message-templates/types/discord/media-channel

[ThreadChannel]: /en/message-templates/types/discord/thread-channel

[Page]: /en/message-templates/types/storage/page

[GuildIndex]: /en/message-templates/types/storage/guild-index

[GuildIndexEntry]: /en/message-templates/types/storage/guild-index-entry

[GuildIndexes]: /en/message-templates/types/storage/guild-indexes

[MemberAttribute]: /en/message-templates/types/storage/member-attribute

[MemberAttributes]: /en/message-templates/types/storage/member-attributes

[Arguments]: /en/message-templates/types/custom-commands/arguments

[Parameters]: /en/message-templates/types/custom-commands/parameters

[Component]: /en/message-templates/types/custom-commands/component

[Modal]: /en/message-templates/types/custom-commands/modal

# Guild

This data type describes all available data about the server.

## Properties { #properties }

| Property      | Type           | Description                                 |
|:--------------|:---------------|:--------------------------------------------|
| `id`          | \[Number]       | Unique identifier                           |
| `name`        | \[String]       | Name                                        |
| `iconUrl`     | \[String]       | Icon URL                                    |
| `bannerUrl`   | \[String]       | Banner URL                                  |
| `afkTimeout`  | \[Number]       | AFK timeout for voice channels (in minutes) |
| `afkChannel`  | \[VoiceChannel] | AFK Voice Channel                           |
| `memberCount` | \[Number]       | Amount of Members (including bots)          |
| `userCount`   | \[Number]       | Amount of Members (excluding bots)          |
| `botCount`    | \[Number]       | Amount of Bots                              |
| `createdAt`   | \[DateTime]     | Creation date and time                      |
| `owner`       | \[Member]       | Owner                                       |
| `selfMember`  | \[Member]       | Bot's member instance                       |
| `boostCount`  | \[Number]       | Amount of active boosts                     |
| `indexes`     | \[GuildIndexes] | Guild Indexes                               |

## Methods { #methods }

### `getChannel(ID)` { #method-getchannel .template-method }

::: tabs

\== Description | mdi-text

Returns channel by given id.

**Returns:** \[TextChannel], \[NewsChannel], \[VoiceChannel], \[StageChannel], \[ForumChannel], \[MediaChannel]

\== Parameters | mdi-code-parentheses

| Parameter | Type               | Description |
|:----------|:-------------------|:------------|
| `ID`      | \[Number], \[String] | Channel ID  |

\== Example | mdi-code-block-braces

```template
{% set channel = guild.getChannel(350338494213783552) %}
```

:::

### `getMember(ID)` { #method-getmember .template-method }

::: tabs

\== Description | mdi-text

Returns member by given id.

**Returns:** \[Member]

\== Parameters | mdi-code-parentheses

| Parameter | Type               | Description |
|:----------|:-------------------|:------------|
| `ID`      | \[Number], \[String] | Member ID   |

\== Example | mdi-code-block-braces

```template
{% set someMember = guild.getMember(247734710682255361) %}
```

:::

### `getRole(ID)` { #method-getrole }

::: tabs

\== Description | mdi-text

Returns role by given id.

**Returns:** \[Role]

\== Parameters | mdi-code-parentheses

| Parameter | Type               | Description |
|:----------|:-------------------|:------------|
| `ID`      | \[Number], \[String] | Role ID     |

\== Example | mdi-code-block-braces

```template
{% set role = guild.getRole(895234675377864736) %}
```

:::

### `clearAttributes(Key)` { #method-clearattributes .template-method }

::: tabs

\== Description | mdi-text

Clears attributes with specified key for all members.

\== Parameters | mdi-code-parentheses

| Parameter | Type     | Description            |
|:----------|:---------|:-----------------------|
| `Key`     | \[String] | Attribute key to clear |

\== Example | mdi-code-block-braces

```template
{% do guild.clearAttributes('myAttribute') %}
```

:::

### `clearAllAttributes()` { #method-clearallattributes .template-method }

::: tabs

\== Description | mdi-text

Clears all attributes for all members.

\== Example | mdi-code-block-braces

```template
{% do guild.clearAllAttributes() %}
```

:::

### `getIndex(Name)` { #method-getindex .template-method }

::: tabs

\== Description | mdi-text

Returns an index by its name.

**Returns:** \[GuildIndex]

\== Parameters | mdi-code-parentheses

| Parameter | Type     | Description |
|:----------|:---------|:------------|
| `Name`    | \[String] | Index name  |

\== Example | mdi-code-block-braces

```template
{% set index = guild.getIndex('myIndex') %}
```

:::
