From 44d2ddc5157f73f9a7042f0ae3a961918430d2e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Serna?= Date: Fri, 5 Aug 2022 14:39:17 -0300 Subject: [PATCH] Add: BaseChannel.delete --- packages/core/src/structures/channels.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/core/src/structures/channels.ts b/packages/core/src/structures/channels.ts index b6e36ee..01f2bb4 100644 --- a/packages/core/src/structures/channels.ts +++ b/packages/core/src/structures/channels.ts @@ -109,6 +109,15 @@ export abstract class BaseChannel implements Model { 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 { + return await this.session.rest.delete(CHANNEL(channelId ?? this.id)); + } + toString(): string { return `<#${this.id}>`; }