Represents a Discord guild channel.

Constructors

Properties

applicationId?: string
appliedTags?: string[]
availableTags?: any[]
bitrate?: number
defaultAutoArchiveDuration: number
defaultForumLayout: number
defaultReactionEmoji?: any
defaultSortOrder?: number
defaultThreadRateLimitPerUser: number
flags: number
guildId?: string
icon?: string
id: string
lastMessageId?: string
lastPinTimestamp?: string
managed?: boolean
member?: Member
memberCount: number
messageCount?: number
name?: string
nsfw: boolean
ownerId?: string
parentId?: string
permissionOverwrites?: any[]
permissions?: string
position?: number
rateLimitPerUser?: number
recipients?: any[]
rtcRegion?: string
threadMetadata?: any
topic?: string
totalMessageSent?: number
type: number
userLimit?: number
videoQualityMode: number = 1

Methods

  • Creates a new channel with the specified options.

    This function accepts either a ChannelPayload instance or a plain options object to create and send a channel creation request. It validates the options, prepares the payload, and then sends the request to create the channel. Finally, it returns a promise that resolves to the created channel's data.

    Parameters

    • options: object | ChannelPayload

      The channel creation options, which can be an instance of ChannelPayload or a plain object with channel data.

    Returns Promise<any>

    A promise that resolves to the newly created channel's data.

    Error If there is an issue with the provided options or the API request.

  • Creates a new invite for this channel.

    Sends a request to the Discord API to create an invite link with the specified options.

    Parameters

    Returns Promise<Invite>

    The invite object returned from the API.

    Throws if the request fails due to permission issues, invalid parameters, or network errors.

  • Deletes the channel from the guild.

    This method sends a request to the Discord API to permanently delete the specified channel. It is important to note that this action cannot be undone, and the channel will be removed from the guild and all associated data will be lost.

    Returns Promise<void>

    A promise that resolves when the channel has been successfully deleted.

    Throws an error if the deletion request fails. This may occur due to insufficient permissions or if the channel does not exist.

  • Edits the properties of the channel with the specified options.

    This method sends a request to the Discord API to update the channel's attributes identified by its ID within the guild. The updated channel data will be reflected in the current instance after the operation is successful.

    Parameters

    • options: object | ChannelPayload

      The options for editing the channel, which can be an instance of ChannelPayload or a plain object with channel data.

    Returns Promise<GuildChannel>

    A promise that resolves to the updated GuildChannel instance.

    If there is an issue with the provided options or the API request fails, such as insufficient permissions or invalid data.

  • Retrieves all active invites for this guild channel.

    This method calls the Discord API to fetch all invite links that have been created for this specific channel. The returned invites include metadata such as the creator, usage limits, expiration time, etc.

    ⚠️ Requires the MANAGE_CHANNELS permission on the channel.

    Returns Promise<Invite[]>

    A promise that resolves to an array of Invite objects.

    Throws if the request fails due to permission issues, network errors, or invalid channel ID.

  • Sends a message to the channel with the specified options.

    This function accepts either a MessagePayload instance or a plain options object to create and send a message. It processes attachments and files, then sends the message to the channel. Finally, it returns a Message instance representing the sent message.

    Parameters

    • options: object | MessagePayload

      The message options, which can be an instance of MessagePayload or a plain object with message data.

    Returns Promise<any>

    A promise that resolves to a Message instance representing the sent message.

    Error If there is an issue with processing the attachments or files.