Yor.ts | classes/Guild
Class: Guild
Hierarchy
-
↳
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
Overrides
Defined in
Properties
client
• client: YorClient
Inherited from
Defined in
emojis
• emojis: Emoji
[]
Defined in
features
• features: GuildFeature
[]
Defined in
id
• id: string
Defined in
joinedTimestamp
• Optional
joinedTimestamp: number
Defined in
premiumTier
• premiumTier: GuildPremiumTier
Defined in
raw
• raw: APIGuild
Defined in
roles
• roles: Role
[]
Defined in
stickers
• stickers: Sticker
[]
Defined in
Methods
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
A promise that resolves when the channel is created.
Defined in
createTemplate
▸ 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
edit
Edits the guild with the given data.
Parameters
Name | Type | Description |
---|---|---|
data | RESTPatchAPIGuildJSONBody | The data to edit the guild with. |
Returns
A promise that resolves with the edited guild.
Defined in
fetchAuditLogs
▸ 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
fetchOnboarding
▸ fetchOnboarding(): Promise
<APIGuildOnboarding
>
Fetches the onboarding data for the guild.
Returns
Promise
<APIGuildOnboarding
>
- The onboarding data for the guild.
Defined in
fetchPreview
▸ fetchPreview(): Promise
<APIGuildPreview
>
Obtains a guild preview for this guild from Discord.
Returns
Promise
<APIGuildPreview
>
Defined in
fetchStickers
▸ fetchStickers(): Promise
<APISticker
[]>
Fetches the stickers.
Returns
Promise
<APISticker
[]>
The result of the API call.
Defined in
fetchTemplates
▸ fetchTemplates(): Promise
<RESTGetAPIGuildTemplatesResult
>
Fetches the templates for the guild.
Returns
Promise
<RESTGetAPIGuildTemplatesResult
>
The result of the fetch operation.
Defined in
fetchVanity
▸ fetchVanity(): Promise
<RESTGetAPIGuildVanityUrlResult
>
Retrieves the vanity URL of the guild.
Returns
Promise
<RESTGetAPIGuildVanityUrlResult
>
The result of the API call
Defined in
fetchWebhooks
▸ fetchWebhooks(): Promise
<APIWebhook
[]>
Fetches the webhooks.
Returns
Promise
<APIWebhook
[]>
The webhooks.
Defined in
fetchWelcomeScreen
▸ 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
fetchWidget
▸ fetchWidget(): Promise
<APIGuildWidget
>
Fetches the widget for the guild.
Returns
Promise
<APIGuildWidget
>
The guild widget.
Defined in
getIntegrations
▸ 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
joinedAt
▸ 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
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.