Add: BaseChannel.delete

This commit is contained in:
Nicolás Serna 2022-08-05 14:39:17 -03:00
parent 13f11b9b5e
commit 44d2ddc515

View File

@ -109,6 +109,15 @@ export abstract class BaseChannel implements Model {
return ChannelFactory.from(this.session, channel); return ChannelFactory.from(this.session, channel);
} }
/**
* Deletes a channel.
* @param channelId The channel id to delete.
* @link https://discord.com/developers/docs/topics/gateway#channel-delete
*/
async delete(channelId?: Snowflake): Promise<Channel> {
return await this.session.rest.delete<Channel>(CHANNEL(channelId ?? this.id));
}
toString(): string { toString(): string {
return `<#${this.id}>`; return `<#${this.id}>`;
} }