class MediaChannel

export class MediaChannel extends ThreadOnlyChannel

Represents a media channel.

availableTags : GuildForumTag[]

The set of tags that can be used in this channel.

Inherited from: ThreadOnlyChannel

readonly
client : Client<true>

The client that instantiated this

Inherited from: Base

readonly
createdAt : Date

The time the channel was created at

Inherited from: GuildChannel

readonly
createdTimestamp : number

The timestamp the channel was created at

Inherited from: GuildChannel

defaultAutoArchiveDuration : ThreadAutoArchiveDuration | null

The default auto archive duration for newly created threads in this channel.

Inherited from: ThreadOnlyChannel

defaultReactionEmoji : DefaultReactionEmoji | null

The emoji to show in the add reaction button on a thread in a guild forum channel

Inherited from: ThreadOnlyChannel

defaultSortOrder : SortOrderType | null

The default sort order mode used to order posts

Inherited from: ThreadOnlyChannel

defaultThreadRateLimitPerUser : number | null

The initial rate limit per user (slowmode) to set on newly created threads in a channel.

Inherited from: ThreadOnlyChannel

readonly
deletable : boolean

Whether the channel is deletable by the client user

Inherited from: GuildChannel

The flags that are applied to the channel. This is only null in a PartialGroupDMChannel. In all other cases, it is not null.

Inherited from: GuildChannel

guild : Guild

The guild the channel is in

Inherited from: GuildChannel

guildId : Snowflake

The id of the guild the channel is in

Inherited from: GuildChannel

id : Snowflake

The channel's id

Inherited from: BaseChannel

readonly
manageable : boolean

Whether the channel is manageable by the client user

Inherited from: GuildChannel

readonly
members : Collection<Snowflake, GuildMember>

A collection of cached members of this channel, mapped by their ids. Members that can view this channel, if the channel is text-based. Members in the channel, if the channel is voice-based.

Inherited from: GuildChannel

name : string

The name of the guild channel

Inherited from: GuildChannel

nsfw : boolean

If this channel is considered NSFW.

Inherited from: ThreadOnlyChannel

readonly
parent : CategoryChannel | null

The category parent of this channel

Inherited from: GuildChannel

parentId : Snowflake | null

The id of the category parent of this channel

Inherited from: GuildChannel

readonly
partial : false

Whether this Channel is a partial This is always false outside of DM channels.

Inherited from: BaseChannel

permissionOverwrites : PermissionOverwriteManager

A manager of permission overwrites that belong to this channel

Inherited from: GuildChannel

readonly
permissionsLocked : boolean | null

If the permissionOverwrites match the parent channel, null if no parent

Inherited from: GuildChannel

readonly
position : number

The position of the channel

Inherited from: GuildChannel

rateLimitPerUser : number | null

The rate limit per user (slowmode) for this channel.

Inherited from: ThreadOnlyChannel

rawPosition : number

The raw position of the channel from Discord

Inherited from: GuildChannel

A manager of the threads belonging to this channel

Inherited from: ThreadOnlyChannel

topic : string | null

The topic of this channel.

Inherited from: ThreadOnlyChannel

The type of the channel

readonly
url : string

The URL to the channel

Inherited from: BaseChannel

readonly
viewable : boolean

Whether the channel is viewable by the client user

Inherited from: GuildChannel

clone() : Promise<this>

Clones this channel.

Inherited from: GuildChannel

createInvite() : Promise<Invite>

Creates an invite to this guild channel.

Examples:
// Create an invite to a channel
channel.createInvite()
  .then(invite => console.log(`Created an invite with a code of ${invite.code}`))
  .catch(console.error);

Inherited from: ThreadOnlyChannel

createWebhook() : Promise<Webhook>

Creates a webhook for the channel.

Examples:
// Create a webhook for the current channel
channel.createWebhook({
  name: 'Snek',
  avatar: 'https://i.imgur.com/mI8XcpG.jpg',
  reason: 'Needed a cool new Webhook'
})
  .then(console.log)
  .catch(console.error)

Returns: Returns the created Webhook *

Inherited from: ThreadOnlyChannel

delete(
reason?: string
) : Promise<this>

Deletes this channel.

Examples:
// Delete the channel
channel.delete('making room for new channels')
  .then(console.log)
  .catch(console.error);

Inherited from: GuildChannel

edit() : Promise<this>

Edits the channel.

Examples:
// Edit a channel
channel.edit({ name: 'new-channel' })
  .then(console.log)
  .catch(console.error);

Inherited from: GuildChannel

equals(
channel: GuildChannel
) : boolean

Checks if this channel has the same type, topic, position, name, overwrites, and id as another channel. In most cases, a simple channel.id === channel2.id will do, and is much faster too.

Inherited from: GuildChannel

fetch(
force?: boolean
) : Promise<this>

Fetches this channel.

Inherited from: BaseChannel

fetchInvites(
cache?: boolean
) : Promise<Collection<string, Invite>>

Fetches a collection of invites to this guild channel. Resolves with a collection mapping invites by their codes.

Inherited from: ThreadOnlyChannel

fetchWebhooks() : Promise<Collection<Snowflake, Webhook>>

Fetches all webhooks for the channel.

Examples:
// Fetch webhooks
channel.fetchWebhooks()
  .then(hooks => console.log(`This channel has ${hooks.size} hooks`))
  .catch(console.error);

Inherited from: ThreadOnlyChannel

Indicates whether this channel is DM-based (either a DMChannel or a PartialGroupDMChannel).

Inherited from: BaseChannel

isTextBased() : this is GuildBasedChannel & TextBasedChannel

Indicates whether this channel is text-based.

Inherited from: GuildChannel

isThread() : this is AnyThreadChannel

Indicates whether this channel is a ThreadChannel.

Inherited from: BaseChannel

isThreadOnly() : this is ThreadOnlyChannel

Indicates whether this channel is thread-only.

Inherited from: BaseChannel

isVoiceBased() : this is VoiceBasedChannel

Indicates whether this channel is voice-based.

Inherited from: BaseChannel

lockPermissions() : Promise<this>

Locks in the permission overwrites from the parent channel.

Inherited from: GuildChannel

permissionsFor(
memberOrRole: GuildMember | Role
checkAdmin?: boolean
) : Readonly<PermissionsBitField>

Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites.

setAvailableTags(
availableTags: readonly GuildForumTagData[]
reason?: string
) : Promise<this>

Sets the available tags for this forum channel

Inherited from: ThreadOnlyChannel

setDefaultAutoArchiveDuration(
defaultAutoArchiveDuration: ThreadAutoArchiveDuration
reason?: string
) : Promise<this>

Sets the default auto archive duration for all newly created threads in this channel.

Inherited from: ThreadOnlyChannel

setDefaultReactionEmoji(
defaultReactionEmoji: DefaultReactionEmoji | null
reason?: string
) : Promise<this>

Sets the default reaction emoji for this channel

Inherited from: ThreadOnlyChannel

setDefaultSortOrder(
defaultSortOrder: SortOrderType | null
reason?: string
) : Promise<this>

Sets the default sort order mode used to order posts

Inherited from: ThreadOnlyChannel

setDefaultThreadRateLimitPerUser(
defaultThreadRateLimitPerUser: number
reason?: string
) : Promise<this>

Sets the default rate limit per user (slowmode) for new threads in this channel

Inherited from: ThreadOnlyChannel

setName(
name: string
reason?: string
) : Promise<this>

Sets a new name for the guild channel.

Examples:
// Set a new channel name
channel.setName('not_general')
  .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))
  .catch(console.error);

Inherited from: GuildChannel

setNSFW(
nsfw?: boolean
reason?: string
) : Promise<this>

Sets whether this channel is flagged as NSFW.

Inherited from: ThreadOnlyChannel

setParent() : Promise<this>

Sets the parent of this channel.

Examples:
// Add a parent to a channel
message.channel.setParent('355908108431917066', { lockPermissions: false })
  .then(channel => console.log(`New parent of ${message.channel.name}: ${channel.name}`))
  .catch(console.error);

Inherited from: GuildChannel

setPosition() : Promise<this>

Sets a new position for the guild channel.

Examples:
// Set a new channel position
channel.setPosition(2)
  .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))
  .catch(console.error);

Inherited from: GuildChannel

setRateLimitPerUser(
rateLimitPerUser: number
reason?: string
) : Promise<this>

Sets the rate limit per user (slowmode) for this channel.

Inherited from: ThreadOnlyChannel

setTopic(
topic: string | null
reason?: string
) : Promise<this>

Sets a new topic for the guild channel.

Examples:
// Set a new channel topic
channel.setTopic('needs more rate limiting')
  .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))
  .catch(console.error);

Inherited from: ThreadOnlyChannel

toJSON(
...props: Record<string, boolean | string>[]
) : unknown

Inherited from: Base

toString() : ChannelMention

When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.

Examples:
// Logs: Hello from <#123456789012345678>!
console.log(`Hello from ${channel}!`);

Inherited from: GuildChannel

valueOf() : string

Inherited from: Base