ChannelShorter
Signature
export declare class ChannelShorter extends BaseShorterProperties
0No properties.
Methods
16Methods
fetch(id: string, force?: boolean): Promise<AllChannels>;Fetches a channel by its ID.
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.
A Promise that resolves to the fetched channel.
raw(id: string, force?: boolean): Promise<APIChannel>;delete(id: string, optional?: ChannelShorterOptionalParams): Promise<AllChannels>;Deletes a channel by its ID.
id- The ID of the channel to delete.
optional- Optional parameters for the deletion.
A Promise that resolves to the deleted channel.
edit(id: string, body: RESTPatchAPIChannelJSONBody, optional?: ChannelShorterOptionalParams): Promise<AllChannels>;Edits a channel by its ID.
id- The ID of the channel to edit.
body- The updated channel data.
optional- Optional parameters for the editing.
A Promise that resolves to the edited channel.
editOverwrite(channelId: string, overwriteId: string, raw: ChannelShorterOverwriteBody, optional?: ChannelShorterOptionalParams): Promise<void>;Edits or creates a permission overwrite for a channel.
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.
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.
id- The ID of the channel.
A Promise that resolves when the typing indicator is successfully sent.
pins(channelId: string, query?: RESTGetAPIChannelMessagesPinsQuery): Promise<{ hasMore: boolean; items: { pinnedAt: number; message: MessageStructure; }[];}>;setPin(messageId: string, channelId: string, reason?: string): Promise<undefined>;Pins a message in the channel.
messageId- The ID of the message to pin.
channelId- The ID of the channel.
reason- The reason for pinning the message.
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.
messageId- The ID of the message to unpin.
channelId- The ID of the channel.
reason- The reason for unpinning the message.
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).
channelId- The ID of the parent channel.
reason- The reason for unpinning the message.
A promise that resolves when the thread is succesfully created.
memberPermissions(channelId: string, member: GuildMember, checkAdmin?: boolean): Promise<PermissionsBitField>;overwritesFor(channelId: string, member: GuildMember): Promise<{ everyone: { type: OverwriteType; id: string; deny: PermissionsBitField; allow: PermissionsBitField; guildId: string; } | undefined; roles: { type: OverwriteType; id: string; deny: PermissionsBitField; allow: PermissionsBitField; guildId: string; }[]; member: { type: OverwriteType; id: string; deny: PermissionsBitField; allow: PermissionsBitField; guildId: string; } | undefined;}>;rolePermissions(channelId: string, role: GuildRole, checkAdmin?: boolean): Promise<PermissionsBitField>;fetchMessages(channelId: string, query?: RESTGetAPIChannelMessagesQuery): Promise<MessageStructure[]>;setVoiceStatus(channelId: string, status?: string | null): Promise<undefined>;