Add BaseChannel.fetch method

This commit is contained in:
Nicolás Serna 2022-07-30 19:39:47 -03:00
parent c5ef900b38
commit 1b814cebdf

View File

@ -102,6 +102,12 @@ export abstract class BaseChannel implements Model {
return this.type === ChannelTypes.GuildStageVoice;
}
async fetch(): Promise<Channel> {
const channel = await this.session.rest.get<DiscordChannel>(CHANNEL(this.id));
return ChannelFactory.from(this.session, channel);
}
toString(): string {
return `<#${this.id}>`;
}