Extends
Members
(readonly) client :Client
The client that instantiated this
Type:
- Overrides:
- Source:
(readonly) createdAt :Date
The time the channel was created at
Type:
- Date
- Source:
(readonly) createdTimestamp :number
The timestamp the channel was created at
Type:
- number
- Source:
deleted :boolean
Whether the channel has been deleted
Type:
- boolean
- Source:
id :Snowflake
The unique ID of the channel
Type:
- Source:
type :string
The type of the channel, either:
* `dm` - a DM channel
* `text` - a guild text channel
* `voice` - a guild voice channel
* `category` - a guild category channel
* `news` - a guild news channel
* `store` - a guild store channel
* `unknown` - a generic channel of unknown type, could be Channel or GuildChannel
Type:
- string
- Source:
Methods
delete() → {Promise.<Channel>}
Deletes this channel.
- Source:
Returns:
- Type
- Promise.<Channel>
Example
// Delete the channel
channel.delete()
.then(console.log)
.catch(console.error);
fetch(forceopt) → {Promise.<Channel>}
Fetches this channel.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
force |
boolean |
<optional> |
false | Whether to skip the cache check and request the API |
- Source:
Returns:
- Type
- Promise.<Channel>
isText() → {boolean}
Indicates whether this channel is text-based.
- Source:
Returns:
- Type
- boolean
toString() → {string}
When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.
- Source:
Returns:
- Type
- string
Example
// Logs: Hello from <#123456789012345678>!
console.log(`Hello from ${channel}!`);