From 2fadcfa4079c1d24b35b30d494b4e998501453b0 Mon Sep 17 00:00:00 2001 From: ZiomaleQ Date: Tue, 5 Jan 2021 16:27:03 +0100 Subject: [PATCH] awaitAvailability function returns Promise now --- src/structures/guild.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structures/guild.ts b/src/structures/guild.ts index 9415747..771eea0 100644 --- a/src/structures/guild.ts +++ b/src/structures/guild.ts @@ -309,13 +309,13 @@ export class Guild extends Base { /** * Fulfills promise when guild becomes available */ - async awaitAvailability(): Promise { + async awaitAvailability(): Promise { return await new Promise((resolve, reject) => { if(!this.unavailable) return; const listener = (guild: Guild): void => { if (guild.id === this.id) { this.client.removeListener('guildLoaded', listener); - resolve(); + resolve(this); } }; this.client.on('guildLoaded', listener);