Channel
classe · Source
Represents any channel on Discord.
Extends: Base
Properties
type
The type of the channel Source
id
The channel's id Source
flags
The flags that are applied to the channel. Source
createdTimestamp
The timestamp the channel was created at Source
createdAt
The time the channel was created at Source
deleted
Whether or not the structure has been deleted Source
partial
Whether this Channel is a partial This is always false outside of DM channels. Source
client
The client that instantiated this Source
Methods
toString
When concatenated with a string, this automatically returns the channel's mention instead of the Channel object. Returns: string
// Logs: Hello from <#123456789012345678>!
console.log(`Hello from ${channel}!`);delete
Deletes this channel. Returns: Promise<Channel>
// Delete the channel
channel.delete()
.then(console.log)
.catch(console.error);fetch
Fetches this channel. Parameters
| Name | Type | Description |
|---|---|---|
force? | boolean | Whether to skip the cache check and request the API Default: true. |
Returns: Promise<Channel>Source
isText
Indicates whether this channel is text-based. Returns: booleanSource
isVoice
Indicates whether this channel is voice-based. Returns: booleanSource
isThread
Indicates whether this channel is a ThreadChannel. Returns: booleanSource
isThreadOnly
Indicates whether this channel is ThreadOnlyChannel. Returns: booleanSource
isDirectory
Indicates whether this channel is a DirectoryChannelReturns: booleanSource