ChannelShorter

Signature

export declare class ChannelShorter extends BaseShorter

Methods

fetch(id: string, force?: boolean): Promise<AllChannels>;

Fetches a channel by its ID.

Parameters
id
The ID of the channel to fetch.
force
Whether to force fetching the channel from the API even if it exists in the cache.
Returns

A Promise that resolves to the fetched channel.

delete(id: string, optional?: ChannelShorterOptionalParams): Promise<AllChannels>;

Deletes a channel by its ID.

Parameters
id
The ID of the channel to delete.
optional
Optional parameters for the deletion.
Returns

A Promise that resolves to the deleted channel.

editOverwrite(channelId: string, overwriteId: string, raw: ChannelShorterOverwriteBody, optional?: ChannelShorterOptionalParams): Promise<void>;

Edits or creates a permission overwrite for a channel.

Parameters
channelId
The ID of the channel.
overwriteId
The ID of the role or member overwrite.
body
The overwrite payload.
optional
Optional parameters including guild id and reason.
deleteOverwrite(channelId: string, overwriteId: string, optional?: ChannelShorterOptionalParams): Promise<void>;

Deletes a permission overwrite from a channel.

Parameters
channelId
The ID of the channel.
overwriteId
The ID of the role or member overwrite.
optional
Optional parameters including guild id and reason.
typing(id: string): Promise<void>;

Sends a typing indicator to the channel.

Parameters
id
The ID of the channel.
Returns

A Promise that resolves when the typing indicator is successfully sent.

setPin(messageId: string, channelId: string, reason?: string): Promise<undefined>;

Pins a message in the channel.

Parameters
messageId
The ID of the message to pin.
channelId
The ID of the channel.
reason
The reason for pinning the message.
Returns

A Promise that resolves when the message is successfully pinned.

deletePin(messageId: string, channelId: string, reason?: string): Promise<undefined>;

Unpins a message in the channel.

Parameters
messageId
The ID of the message to unpin.
channelId
The ID of the channel.
reason
The reason for unpinning the message.
Returns

A Promise that resolves when the message is successfully unpinned.

thread(channelId: string, body: ThreadCreateBodyRequest, reason?: string): Promise<ThreadChannelStructure>;

Creates a new thread in the channel (only guild based channels).

Parameters
channelId
The ID of the parent channel.
reason
The reason for unpinning the message.
Returns

A promise that resolves when the thread is succesfully created.

setVoiceStatus(channelId: string, status?: string | null): Promise<undefined>;