Class: Guild
Hierarchy
-
Base↳Guild
Table of contents
Constructors
Properties
Methods
- createChannel
- createTemplate
- edit
- fetchAuditLogs
- fetchOnboarding
- fetchPreview
- fetchStickers
- fetchTemplates
- fetchVanity
- fetchWebhooks
- fetchWelcomeScreen
- fetchWidget
- getIntegrations
- joinedAt
- maximumBitrate
Constructors
constructor
• new Guild(client, data): Guild
Initializes a new instance of the Constructor class.
Parameters
| Name | Type | Description |
|---|---|---|
client | YorClient | The client object. |
data | APIGuild | The APIGuild data. |
Returns
Guild
Overrides
Base.constructorDefined in
src/structures/Guild.ts:46Properties
client
• client:YorClient
Inherited from
Base.clientDefined in
src/structures/Base.ts:4emojis
• emojis:Emoji[]
Defined in
src/structures/Guild.ts:35features
• features:GuildFeature[]
Defined in
src/structures/Guild.ts:31id
• id:string
Defined in
src/structures/Guild.ts:30joinedTimestamp
•Optional joinedTimestamp: number
Defined in
src/structures/Guild.ts:33premiumTier
• premiumTier:GuildPremiumTier
Defined in
src/structures/Guild.ts:32raw
• raw:APIGuild
Defined in
src/structures/Guild.ts:38roles
• roles:Role[]
Defined in
src/structures/Guild.ts:34stickers
• stickers:Sticker[]
Defined in
src/structures/Guild.ts:36Methods
createChannel
▸ createChannel(data): Promise<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<Channel>
A promise that resolves when the channel is created.
Defined in
src/structures/Guild.ts:231createTemplate
▸ createTemplate(name, description?): 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<APITemplate>
Defined in
src/structures/Guild.ts:133edit
▸ edit(data): Promise<Guild>
Edits the guild with the given data.
Parameters
| Name | Type | Description |
|---|---|---|
data | RESTPatchAPIGuildJSONBody | The data to edit the guild with. |
Returns
Promise<Guild>
A promise that resolves with the edited guild.
Defined in
src/structures/Guild.ts:220fetchAuditLogs
▸ fetchAuditLogs(options?): Promise<Omit<APIAuditLog, "users"> & { users: User[] }>
Fetches the audit logs for the API.
Parameters
| Name | Type | Description |
|---|---|---|
options? | RESTGetAPIAuditLogQuery | Optional query parameters for the audit log request. |
Returns
Promise<Omit<APIAuditLog, "users"> & { users: User[] }>
A promise that resolves to the audit logs along with the users associated with the logs.
Defined in
src/structures/Guild.ts:194fetchOnboarding
▸ fetchOnboarding():Promise<APIGuildOnboarding>
Fetches the onboarding data for the guild.
Returns
Promise<APIGuildOnboarding>
- The onboarding data for the guild.
Defined in
src/structures/Guild.ts:210fetchPreview
▸ fetchPreview():Promise<APIGuildPreview>
Obtains a guild preview for this guild from Discord.
Returns
Promise<APIGuildPreview>
Defined in
src/structures/Guild.ts:147fetchStickers
▸ fetchStickers():Promise<APISticker[]>
Fetches the stickers.
Returns
Promise<APISticker[]>
The result of the API call.
Defined in
src/structures/Guild.ts:174fetchTemplates
▸ fetchTemplates():Promise<RESTGetAPIGuildTemplatesResult>
Fetches the templates for the guild.
Returns
Promise<RESTGetAPIGuildTemplatesResult>
The result of the fetch operation.
Defined in
src/structures/Guild.ts:114fetchVanity
▸ fetchVanity():Promise<RESTGetAPIGuildVanityUrlResult>
Retrieves the vanity URL of the guild.
Returns
Promise<RESTGetAPIGuildVanityUrlResult>
The result of the API call
Defined in
src/structures/Guild.ts:156fetchWebhooks
▸ fetchWebhooks():Promise<APIWebhook[]>
Fetches the webhooks.
Returns
Promise<APIWebhook[]>
The webhooks.
Defined in
src/structures/Guild.ts:165fetchWelcomeScreen
▸ fetchWelcomeScreen():Promise<APIGuildWelcomeScreen>
Fetches the welcome screen for the guild.
Returns
Promise<APIGuildWelcomeScreen>
A promise that resolves to the welcome screen for the guild.
Defined in
src/structures/Guild.ts:123fetchWidget
▸ fetchWidget():Promise<APIGuildWidget>
Fetches the widget for the guild.
Returns
Promise<APIGuildWidget>
The guild widget.
Defined in
src/structures/Guild.ts:184getIntegrations
▸ getIntegrations():Promise<RESTGetAPIGuildIntegrationsResult>
Retrieves the integrations for the guild.
Returns
Promise<RESTGetAPIGuildIntegrationsResult>
A promise that resolves with the result of the API call.
Defined in
src/structures/Guild.ts:105joinedAt
▸ joinedAt():undefined | Date
Returns the date when the user joined.
Returns
undefined | Date
The date when the user joined, or undefined if no joined timestamp is available.
Defined in
src/structures/Guild.ts:74maximumBitrate
▸ 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.
