feat(invite gateway events)

This commit is contained in:
CyberKnight007 2020-12-02 12:59:13 +05:30
parent e01d10dd66
commit 2fbd6c99fc
2 changed files with 1 additions and 2 deletions

View file

@ -8,7 +8,6 @@ export const inviteDelete: GatewayEventHandler = async (
gateway: Gateway,
d: InviteDeletePayload
) => {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const guild: Guild | undefined = await gateway.client.guilds.get(d.guild_id!)
// Weird case, shouldn't happen

View file

@ -19,7 +19,7 @@ export class InviteManager extends BaseManager<InvitePayload, Invite> {
return new Invite(this.client, raw)
}
async fetch(id: string): Promise<Invite> {
async fetch(id: string): Promise<Invite | undefined> {
return await new Promise((resolve, reject) => {
this.client.rest
.get(GUILD_INVITES(this.guild.id))