class BaseChannel

extends

Base
abstract
export abstract class BaseChannel extends Base

Represents any channel on Discord.

Constructors

constructor(
client: Client<true>
immediatePatch?: boolean
)

Constructs a new instance of the BaseChannel class

readonly
client : Client<true>

The client that instantiated this

Inherited from: Base

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.

Examples:
// Delete the channel
channel.delete()
  .then(console.log)
  .catch(console.error);

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

Fetches this channel.

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

isSendable() : this is SendableChannels

Indicates whether this channel is sendable.

isTextBased() : this is TextBasedChannel

Indicates whether this channel is text-based.

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: Record<string, boolean | string>[]
) : unknown

Inherited from: Base

toString() : ChannelMention | UserMention

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}!`);

valueOf() : string

Inherited from: Base