diff --git a/services/kanao-gateway/src/Listeners/Caches/Guilds/GuildCreateListener.ts b/services/kanao-gateway/src/Listeners/Caches/Guilds/GuildCreateListener.ts index aa89e21c..b1e00d62 100644 --- a/services/kanao-gateway/src/Listeners/Caches/Guilds/GuildCreateListener.ts +++ b/services/kanao-gateway/src/Listeners/Caches/Guilds/GuildCreateListener.ts @@ -236,7 +236,9 @@ export class GuildCreateListener extends Listener { } } - const voiceState = payload.data.d.voice_states.find(voice => voice.user_id === clientId && voice.channel_id !== undefined)!; + const voiceState = payload.data.d.voice_states.find(voice => voice.user_id === clientId && voice.channel_id !== undefined); + + if (voiceState) { await this.store.drizzle .insert(voiceStates) @@ -269,6 +271,7 @@ export class GuildCreateListener extends Listener { suppress: sql`EXCLUDED.suppress` } }); + } await this.store.amqp.publish( RabbitMQ.GATEWAY_QUEUE_SEND,