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
- Overrides:
- Source:
(readonly) createdTimestamp :number
The timestamp the channel was created at
Type:
- number
- Overrides:
- Source:
deleted :boolean
Whether the channel has been deleted
Type:
- boolean
- Overrides:
- Source:
(nullable) icon :string
The hash of the channel icon
Type:
- string
id :Snowflake
The unique ID of the channel
Type:
- Overrides:
- Source:
name :string
The name of this Group DM Channel
Type:
- string
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
- Overrides:
- Source:
Methods
delete() → {Promise.<Channel>}
Deletes this channel.
- Overrides:
- 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 |
- Overrides:
- Source:
Returns:
- Type
- Promise.<Channel>
iconURL(optionsopt) → {string}
The URL to this channel's icon.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
ImageURLOptions |
<optional> |
{} | Options for the Image URL |
Returns:
- Type
- string
isText() → {boolean}
Indicates whether this channel is text-based.
- Overrides:
- Source:
Returns:
- Type
- boolean
toString() → {string}
When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.
- Overrides:
- Source:
Returns:
- Type
- string
Example
// Logs: Hello from <#123456789012345678>!
console.log(`Hello from ${channel}!`);