From 055a030c4e9e465291e39d22cfbe68c9b53b09c1 Mon Sep 17 00:00:00 2001 From: Radoslaw Partyka Date: Fri, 1 Jan 2021 17:09:41 +0100 Subject: [PATCH] Code / style fixes --- src/structures/guild.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/structures/guild.ts b/src/structures/guild.ts index cbc9aef..5645bf0 100644 --- a/src/structures/guild.ts +++ b/src/structures/guild.ts @@ -163,6 +163,8 @@ export class Guild extends Base { constructor(client: Client, data: GuildPayload) { super(client, data) + this.id = data.id + this.unavailable = data.unavailable this.readFromData(data) this.bans = new GuildBans(client, this) this.members = new MembersManager(this.client, this) @@ -298,15 +300,12 @@ export class Guild extends Base { async awaitAvailability( delay: number = 1000 ): Promise { - const promise1 = new Promise((resolve, reject) => { while(true) { - await new Promise(reso => setTimeout(reso, delay)) + await new Promise(resolve => setTimeout(resolve, delay)) if(!this.unavailable) { - resolve() - break; + return; } - } - }); + } } }