class MediaChannel
extends
ThreadOnlyChannelexport class MediaChannel extends ThreadOnlyChannel
Represents a media channel.
Array<GuildForumTag> availableTags :
The set of tags that can be used in this channel.
readonlyClient client :
The client that instantiated this
readonlyDate createdAt :
The time the channel was created at
readonlynumber createdTimestamp :
The timestamp the channel was created at
optionalThreadAutoArchiveDuration defaultAutoArchiveDuration? :
The default auto archive duration for newly created threads in this channel.
optionalDefaultReactionEmoji defaultReactionEmoji? :
The emoji to show in the add reaction button on a thread in a guild forum channel
optionalSortOrderType defaultSortOrder? :
The default sort order mode used to order posts
optionalnumber defaultThreadRateLimitPerUser? :
The initial rate limit per user (slowmode) to set on newly created threads in a channel.
readonlyboolean deletable :
Whether the channel is deletable by the client user
optionalReadonly<ChannelFlagsBitField> flags? :
The flags that are applied to the channel. This is only null
in a PartialGroupDMChannel. In all other cases, it is not null
.
Guild guild :
The guild the channel is in
Snowflake guildId :
The id of the guild the channel is in
Snowflake id :
The channel's id
readonlyboolean manageable :
Whether the channel is manageable by the client user
readonlyCollection<Snowflake, GuildMember> members :
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.
string name :
The name of the guild channel
boolean nsfw :
If this channel is considered NSFW.
readonlyoptionalCategoryChannel parent? :
The category parent of this channel
optionalSnowflake parentId? :
The id of the category parent of this channel
readonlyboolean partial :
Whether this Channel is a partial This is always false outside of DM channels.
PermissionOverwriteManager permissionOverwrites :
A manager of permission overwrites that belong to this channel
readonlyoptionalboolean permissionsLocked? :
If the permissionOverwrites match the parent channel, null if no parent
readonlynumber position :
The position of the channel
optionalnumber rateLimitPerUser? :
The rate limit per user (slowmode) for this channel.
number rawPosition :
The raw position of the channel from Discord
GuildForumThreadManager threads :
A manager of the threads belonging to this channel
optionalstring topic? :
The topic of this channel.
ChannelType.GuildMedia type :
The type of the channel
readonlystring url :
The URL to the channel
readonlyboolean viewable :
Whether the channel is viewable by the client user
createInviteoptions?: InviteCreateOptions) : Promise<Invite> (
Creates an invite to this guild channel.
// 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
createWebhookoptions?: ChannelWebhookCreateOptions) : Promise<Webhook> (
Creates a webhook for the channel.
// 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
fetchInvitescache?: 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
fetchWebhooksPromise<Collection<Snowflake, Webhook>> () :
Fetches all webhooks for the channel.
// Fetch webhooks
channel.fetchWebhooks()
.then(hooks => console.log(`This channel has ${hooks.size} hooks`))
.catch(console.error);
Inherited from: ThreadOnlyChannel
setAvailableTagsavailableTags: GuildForumTagData[]reason?: string) : Promise<this> (
Sets the available tags for this forum channel
Inherited from: ThreadOnlyChannel
setDefaultAutoArchiveDurationdefaultAutoArchiveDuration: ThreadAutoArchiveDurationreason?: string) : Promise<this> (
Sets the default auto archive duration for all newly created threads in this channel.
Inherited from: ThreadOnlyChannel
setDefaultReactionEmojidefaultReactionEmoji: DefaultReactionEmoji | nullreason?: string) : Promise<this> (
Sets the default reaction emoji for this channel
Inherited from: ThreadOnlyChannel
setDefaultSortOrderdefaultSortOrder: SortOrderType | nullreason?: string) : Promise<this> (
Sets the default sort order mode used to order posts
Inherited from: ThreadOnlyChannel
setDefaultThreadRateLimitPerUser) : Promise<this> (
Sets the default rate limit per user (slowmode) for new threads in this channel
Inherited from: ThreadOnlyChannel
Sets whether this channel is flagged as NSFW.
Inherited from: ThreadOnlyChannel
Sets the rate limit per user (slowmode) for this channel.
Inherited from: ThreadOnlyChannel
Sets a new topic for the guild channel.
// 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