refactor: use EventEmitter.off in favour of EventEmitter.removeListener

This commit is contained in:
NotSugden
2020-02-26 20:38:26 +00:00
parent 9953b4d267
commit 2a36dff43a
8 changed files with 28 additions and 28 deletions

View File

@@ -88,7 +88,7 @@ class GuildManager extends BaseManager {
const handleGuild = guild => {
if (guild.id === data.id) {
this.client.removeListener(Events.GUILD_CREATE, handleGuild);
this.client.off(Events.GUILD_CREATE, handleGuild);
this.client.clearTimeout(timeout);
resolve(guild);
}
@@ -96,7 +96,7 @@ class GuildManager extends BaseManager {
this.client.on(Events.GUILD_CREATE, handleGuild);
const timeout = this.client.setTimeout(() => {
this.client.removeListener(Events.GUILD_CREATE, handleGuild);
this.client.off(Events.GUILD_CREATE, handleGuild);
resolve(this.client.guilds.add(data));
}, 10000);
return undefined;