fix: error
This commit is contained in:
parent
1db6aaac8d
commit
e9490ff777
1 changed files with 2 additions and 2 deletions
|
@ -43,7 +43,7 @@ export class ChannelsManager extends BaseManager<ChannelPayload, Channel> {
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
async fetch (id: string): Promise<Channel> {
|
async fetch<T = Channel> (id: string): Promise<T> {
|
||||||
return await new Promise((resolve, reject) => {
|
return await new Promise((resolve, reject) => {
|
||||||
this.client.rest
|
this.client.rest
|
||||||
.get(CHANNEL(id))
|
.get(CHANNEL(id))
|
||||||
|
@ -53,7 +53,7 @@ export class ChannelsManager extends BaseManager<ChannelPayload, Channel> {
|
||||||
if (data.guild_id !== undefined) {
|
if (data.guild_id !== undefined) {
|
||||||
guild = await this.client.guilds.get(data.guild_id)
|
guild = await this.client.guilds.get(data.guild_id)
|
||||||
}
|
}
|
||||||
resolve(getChannelByType(this.client, data as ChannelPayload, guild))
|
resolve((getChannelByType(this.client, data as ChannelPayload, guild) as unknown) as T)
|
||||||
})
|
})
|
||||||
.catch(e => reject(e))
|
.catch(e => reject(e))
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue