> ## Documentation Index
> Fetch the complete documentation index at: https://yor.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Yor.ts | classes/Guild

[yor.ts](../README) / [Exports](../modules) / Guild

# Class: Guild

## Hierarchy

* [`Base`](Base)

  ↳ **`Guild`**

## Table of contents

### Constructors

* [constructor](Guild#constructor)

### Properties

* [client](Guild#client)
* [emojis](Guild#emojis)
* [features](Guild#features)
* [id](Guild#id)
* [joinedTimestamp](Guild#joinedtimestamp)
* [premiumTier](Guild#premiumtier)
* [raw](Guild#raw)
* [roles](Guild#roles)
* [stickers](Guild#stickers)

### Methods

* [createChannel](Guild#createchannel)
* [createTemplate](Guild#createtemplate)
* [edit](Guild#edit)
* [fetchAuditLogs](Guild#fetchauditlogs)
* [fetchOnboarding](Guild#fetchonboarding)
* [fetchPreview](Guild#fetchpreview)
* [fetchStickers](Guild#fetchstickers)
* [fetchTemplates](Guild#fetchtemplates)
* [fetchVanity](Guild#fetchvanity)
* [fetchWebhooks](Guild#fetchwebhooks)
* [fetchWelcomeScreen](Guild#fetchwelcomescreen)
* [fetchWidget](Guild#fetchwidget)
* [getIntegrations](Guild#getintegrations)
* [joinedAt](Guild#joinedat)
* [maximumBitrate](Guild#maximumbitrate)

## Constructors

### constructor

• **new Guild**(`client`, `data`): [`Guild`](Guild)

Initializes a new instance of the Constructor class.

#### Parameters

| Name     | Type                     | Description        |
| :------- | :----------------------- | :----------------- |
| `client` | [`YorClient`](YorClient) | The client object. |
| `data`   | `APIGuild`               | The APIGuild data. |

#### Returns

[`Guild`](Guild)

#### Overrides

[Base](Base).[constructor](Base#constructor)

#### Defined in

[src/structures/Guild.ts:46](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L46)

## Properties

### client

• **client**: [`YorClient`](YorClient)

#### Inherited from

[Base](Base).[client](Base#client)

#### Defined in

[src/structures/Base.ts:4](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Base.ts#L4)

***

### emojis

• **emojis**: [`Emoji`](Emoji)\[]

#### Defined in

[src/structures/Guild.ts:35](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L35)

***

### features

• **features**: `GuildFeature`\[]

#### Defined in

[src/structures/Guild.ts:31](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L31)

***

### id

• **id**: `string`

#### Defined in

[src/structures/Guild.ts:30](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L30)

***

### joinedTimestamp

• `Optional` **joinedTimestamp**: `number`

#### Defined in

[src/structures/Guild.ts:33](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L33)

***

### premiumTier

• **premiumTier**: `GuildPremiumTier`

#### Defined in

[src/structures/Guild.ts:32](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L32)

***

### raw

• **raw**: `APIGuild`

#### Defined in

[src/structures/Guild.ts:38](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L38)

***

### roles

• **roles**: [`Role`](Role)\[]

#### Defined in

[src/structures/Guild.ts:34](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L34)

***

### stickers

• **stickers**: [`Sticker`](Sticker)\[]

#### Defined in

[src/structures/Guild.ts:36](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L36)

## Methods

### createChannel

▸ **createChannel**(`data`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Channel`](Channel)>

Creates a channel with the given data and reason.

#### Parameters

| Name                          | Type                                                                                                                                                                                    | Description                        |
| :---------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------- |
| `data`                        | `Object`                                                                                                                                                                                | The data for creating the channel. |
| `data.flags?`                 | `AddUndefinedToPossiblyUndefinedPropertiesOfInterface`\<`undefined` \| `ChannelFlags`>                                                                                                  | -                                  |
| `data.name`                   | `string`                                                                                                                                                                                | -                                  |
| `data.nsfw?`                  | `AddUndefinedToPossiblyUndefinedPropertiesOfInterface`\<`undefined` \| `boolean`>                                                                                                       | Whether the channel is nsfw        |
| `data.parent_id?`             | `null` \| `string` \| `number`                                                                                                                                                          | -                                  |
| `data.permission_overwrites?` | `APIGuildCreateOverwrite`\[]                                                                                                                                                            | -                                  |
| `data.position?`              | `AddUndefinedToPossiblyUndefinedPropertiesOfInterface`\<`undefined` \| `number`>                                                                                                        | Sorting position of the channel    |
| `data.reason?`                | `string`                                                                                                                                                                                | -                                  |
| `data.type?`                  | `GuildText` \| `GuildVoice` \| `GuildCategory` \| `GuildAnnouncement` \| `AnnouncementThread` \| `PublicThread` \| `PrivateThread` \| `GuildStageVoice` \| `GuildForum` \| `GuildMedia` | -                                  |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Channel`](Channel)>

A promise that resolves when the channel is created.

#### Defined in

[src/structures/Guild.ts:231](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L231)

***

### createTemplate

▸ **createTemplate**(`name`, `description?`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`APITemplate`>

Creates a template for the guild.

#### Parameters

| Name           | Type     | Description                      |
| :------------- | :------- | :------------------------------- |
| `name`         | `string` | The name for the template        |
| `description?` | `string` | The description for the template |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`APITemplate`>

#### Defined in

[src/structures/Guild.ts:133](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L133)

***

### edit

▸ **edit**(`data`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Guild`](Guild)>

Edits the guild with the given data.

#### Parameters

| Name   | Type                        | Description                      |
| :----- | :-------------------------- | :------------------------------- |
| `data` | `RESTPatchAPIGuildJSONBody` | The data to edit the guild with. |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Guild`](Guild)>

A promise that resolves with the edited guild.

#### Defined in

[src/structures/Guild.ts:220](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L220)

***

### fetchAuditLogs

▸ **fetchAuditLogs**(`options?`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Omit`](https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys)\<`APIAuditLog`, `"users"`> & \{ `users`: [`User`](User)\[]  }>

Fetches the audit logs for the API.

#### Parameters

| Name       | Type                      | Description                                          |
| :--------- | :------------------------ | :--------------------------------------------------- |
| `options?` | `RESTGetAPIAuditLogQuery` | Optional query parameters for the audit log request. |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Omit`](https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys)\<`APIAuditLog`, `"users"`> & \{ `users`: [`User`](User)\[]  }>

A promise that resolves to the audit logs along with the users associated with the logs.

#### Defined in

[src/structures/Guild.ts:194](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L194)

***

### fetchOnboarding

▸ **fetchOnboarding**(): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`APIGuildOnboarding`>

Fetches the onboarding data for the guild.

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`APIGuildOnboarding`>

* The onboarding data for the guild.

#### Defined in

[src/structures/Guild.ts:210](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L210)

***

### fetchPreview

▸ **fetchPreview**(): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`APIGuildPreview`>

Obtains a guild preview for this guild from Discord.

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`APIGuildPreview`>

#### Defined in

[src/structures/Guild.ts:147](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L147)

***

### fetchStickers

▸ **fetchStickers**(): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`APISticker`\[]>

Fetches the stickers.

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`APISticker`\[]>

The result of the API call.

#### Defined in

[src/structures/Guild.ts:174](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L174)

***

### fetchTemplates

▸ **fetchTemplates**(): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`RESTGetAPIGuildTemplatesResult`>

Fetches the templates for the guild.

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`RESTGetAPIGuildTemplatesResult`>

The result of the fetch operation.

#### Defined in

[src/structures/Guild.ts:114](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L114)

***

### fetchVanity

▸ **fetchVanity**(): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`RESTGetAPIGuildVanityUrlResult`>

Retrieves the vanity URL of the guild.

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`RESTGetAPIGuildVanityUrlResult`>

The result of the API call

#### Defined in

[src/structures/Guild.ts:156](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L156)

***

### fetchWebhooks

▸ **fetchWebhooks**(): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`APIWebhook`\[]>

Fetches the webhooks.

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`APIWebhook`\[]>

The webhooks.

#### Defined in

[src/structures/Guild.ts:165](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L165)

***

### fetchWelcomeScreen

▸ **fetchWelcomeScreen**(): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`APIGuildWelcomeScreen`>

Fetches the welcome screen for the guild.

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`APIGuildWelcomeScreen`>

A promise that resolves to the welcome screen for the guild.

#### Defined in

[src/structures/Guild.ts:123](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L123)

***

### fetchWidget

▸ **fetchWidget**(): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`APIGuildWidget`>

Fetches the widget for the guild.

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`APIGuildWidget`>

The guild widget.

#### Defined in

[src/structures/Guild.ts:184](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L184)

***

### getIntegrations

▸ **getIntegrations**(): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`RESTGetAPIGuildIntegrationsResult`>

Retrieves the integrations for the guild.

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`RESTGetAPIGuildIntegrationsResult`>

A promise that resolves with the result of the API call.

#### Defined in

[src/structures/Guild.ts:105](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L105)

***

### joinedAt

▸ **joinedAt**(): `undefined` | [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date)

Returns the date when the user joined.

#### Returns

`undefined` | [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date)

The date when the user joined, or undefined if no joined timestamp is available.

#### Defined in

[src/structures/Guild.ts:74](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L74)

***

### maximumBitrate

▸ **maximumBitrate**(): `number`

Calculates and returns the maximum bitrate for audio streaming based on the guild's premium tier and features.

#### Returns

`number`

The maximum bitrate in bits per second.

#### Defined in

[src/structures/Guild.ts:83](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Guild.ts#L83)
