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