fix: botReady emits twice

This commit is contained in:
MARCROCK22 2024-08-17 18:52:07 +00:00
parent b30b6dde24
commit 98c755dac7

View File

@ -190,7 +190,6 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
this.botId = packet.d.user.id;
this.applicationId = packet.d.application.id;
this.me = Transformers.ClientUser(this, packet.d.user, packet.d.application) as never;
await this.events?.execute(packet.t as never, packet, this as Client<true>, shardId);
if (
!(
this.__handleGuilds?.size &&
@ -203,6 +202,7 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
delete this.__handleGuilds;
}
this.debugger?.debug(`#${shardId}[${packet.d.user.username}](${this.botId}) is online...`);
await this.events?.execute(packet.t as never, packet, this as Client<true>, shardId);
break;
default:
await this.events?.execute(packet.t as never, packet, this as Client<true>, shardId);