From 1b814cebdf0315faa6e7f3ebb74d59a2c57bcc64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Serna?= Date: Sat, 30 Jul 2022 19:39:47 -0300 Subject: [PATCH] Add BaseChannel.fetch method --- packages/core/src/structures/channels.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/core/src/structures/channels.ts b/packages/core/src/structures/channels.ts index 49e0913..48c5ed8 100644 --- a/packages/core/src/structures/channels.ts +++ b/packages/core/src/structures/channels.ts @@ -102,6 +102,12 @@ export abstract class BaseChannel implements Model { return this.type === ChannelTypes.GuildStageVoice; } + async fetch(): Promise { + const channel = await this.session.rest.get(CHANNEL(this.id)); + + return ChannelFactory.from(this.session, channel); + } + toString(): string { return `<#${this.id}>`; }