Abstract

BaseChannel

export abstract class BaseChannel extends Base
export abstract class BaseChannel extends Base
Represents any channel on Discord.

Extends

Base
constructor(client, data?, immediatePatch?)
Constructs a new instance of the BaseChannel class
NameTypeOptionalDescription
clientClient<true>NoNone
dataRawChannelDataYesNone
immediatePatchbooleanYesNone
Readonly
client:Client
The client that instantiated this
Readonly
createdAt:Date | null
The time the channel was created at
Readonly
createdTimestamp:number | null
The timestamp the channel was created at
The flags that are applied to the channel. This is only null in a PartialGroupDMChannel. In all other cases, it is not null.
The channel's id
Readonly
partial:false
Whether this Channel is a partial This is always false outside of DM channels.
The type of the channel
Readonly
url:string
The URL to the channel
delete():Promise<this>
Deletes this channel.
Example
// Delete the channel
channel.delete()
.then(console.log)
.catch(console.error);
// Delete the channel
channel.delete()
.then(console.log)
.catch(console.error);
fetch(force?):Promise<this>
Fetches this channel.
NameTypeOptionalDescription
forcebooleanYesWhether to skip the cache check and request the API
Indicates whether this channel is DM-based (either a DMChannel or a PartialGroupDMChannel).
isTextBased():this is TextBasedChannel
Indicates whether this channel is .
isThread():this is AnyThreadChannel
Indicates whether this channel is a ThreadChannel.
isThreadOnly():this is ThreadOnlyChannel
Indicates whether this channel is thread-only.
isVoiceBased():this is VoiceBasedChannel
Indicates whether this channel is voice-based.
toJSON(...props):unknown
NameTypeOptionalDescription
...propsRecord<string, boolean | string>[]NoNone
Inherited from Base
When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.
Example
// Logs: Hello from <#123456789012345678>!
console.log(`Hello from ${channel}!`);
// Logs: Hello from <#123456789012345678>!
console.log(`Hello from ${channel}!`);
valueOf():string