Code fix #2, requirements again

This commit is contained in:
ZiomaleQ 2021-01-05 14:14:24 +01:00
parent 4364d3879b
commit c4a3fbc45c

View file

@ -313,7 +313,7 @@ export class Guild extends Base {
async awaitAvailability(delay: number = 1000): Promise<void> {
if(!this.unavailable) return;
var loaded = false;
var listener = (guild: Guild) => loaded = loaded || guild.id === this.id;
var listener = (guild: Guild): void => { loaded = loaded || guild.id === this.id };
this.client.on('guildLoaded', listener);
while(true) {
await new Promise(resolve => setTimeout(resolve, delay));