Base
↳ Channel
client
, data
): Channel
Constructs a new instance of the class.
Name | Type | Description |
---|---|---|
client | YorClient | The client object. |
data | undefined | { flags? : ChannelFlags ; id : string ; name? : null | string ; type : GuildText | DM | GuildVoice | GroupDM | GuildCategory | GuildAnnouncement | AnnouncementThread | PublicThread | PrivateThread | GuildStageVoice | GuildForum | GuildMedia } | The channel data. |
Channel
Throws
If channel data is not provided.
Private
API: ChannelsAPI
YorClient
Optional
flags: ChannelFlags
string
undefined
| string
Partial
<APIChannel
>
number
messages
): Promise
<void
>
Bulk deletes messages
Name | Type | Description |
---|---|---|
messages | string [] | The data used to bulk delete messages |
Promise
<void
>
Promise that resolves when the messages are deleted
data
): Promise
<APIInvite
>
Creates an invite using the given data and returns the created invite.
Name | Type | Description |
---|---|---|
data | RESTPostAPIChannelInviteJSONBody | The data used to create the invite. |
Promise
<APIInvite
>
The created invite.
data
): Promise
<Webhook
>
Creates a webhook in the current channel or parent channel (if a thread) with the given data
Name | Type | Description |
---|---|---|
data | RESTPostAPIChannelWebhookJSONBody & { reason : string } | The data for creating the webhook. |
Promise
<Webhook
>
A promise that resolves with the created webhook.
Date
Returns the creation date of the object.
Date
The creation date of the object.
number
Returns the created timestamp as a Date object.
number
The created timestamp.
messageId
): Promise
<APIMessage
>
Crossposts a message.
Name | Type | Description |
---|---|---|
messageId | string | The ID of the message to crosspost. |
Promise
<APIMessage
>
A promise that resolves to the crossposted message.
Promise
<APIChannel
>
Deletes the channel
Promise
<APIChannel
>
Promise that resolves to the deleted channel
data
): Promise
<APIChannel
>
Edits the channel
Name | Type | Description |
---|---|---|
data | RESTPatchAPIChannelJSONBody | The data used to edit the channel |
Promise
<APIChannel
>
Promise that resolves to the edited channel
messageId
, data
): Promise
<APIMessage
>
Edits a message.
Name | Type | Description |
---|---|---|
messageId | string | The ID of the message to be edited. |
data | RESTPatchAPIChannelMessageJSONBody & { files? : RawFile [] } | The data to be updated in the message. |
Promise
<APIMessage
>
messageId
): Promise
<APIMessage
>
Fetches a specific message by its ID.
Name | Type | Description |
---|---|---|
messageId | string | The ID of the message to fetch. |
Promise
<APIMessage
>
A Promise that resolves to the fetched message.
data
): Promise
<APIMessage
[]>
Fetches messages using the provided data.
Name | Type | Description |
---|---|---|
data | RESTGetAPIChannelMessagesQuery | The data used to fetch messages. |
Promise
<APIMessage
[]>
A promise that resolves to an array of API messages.
Promise
<APIInvite
[]>
Retrieves the invites.
Promise
<APIInvite
[]>
The list of invites.
Promise
<Webhook
[]>
Gets all webhooks in the current channel or parent channel (if a thread)
Promise
<Webhook
[]>
A promise that resolves with an array of webhooks.
boolean
Determines if the channel is DM-based.
boolean
boolean
Checks if the function is text-based.
boolean
true if the function is text-based, false otherwise.
boolean
Checks if the channel type is a thread.
boolean
true if the channel type is a thread, false otherwise
boolean
Determines if the channel is voice-based.
boolean
Returns true if the channel is voice-based, false otherwise.
messageId
): Promise
<void
>
Pin a message
Name | Type | Description |
---|---|---|
messageId | string | The data used to pin a message |
Promise
<void
>
Promise that resolves when the message is pinned
data
): Promise
<APIMessage
>
Sends a message with the given data.
Name | Type | Description |
---|---|---|
data | RESTPostAPIChannelMessageJSONBody & { files? : RawFile [] } | The data for the message. |
Promise
<APIMessage
>
A promise that resolves to the created message.
messageId
): Promise
<void
>
Unpin a message
Name | Type | Description |
---|---|---|
messageId | string | The data used to unpin a message |
Promise
<void
>
Promise that resolves when the message is unpinned