Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
fix(GuildCreateListener): check if voiceState is available
Browse files Browse the repository at this point in the history
Co-authored-by: KagChi <[email protected]>
Co-authored-by: Vann <[email protected]>
  • Loading branch information
3 people authored Feb 20, 2024
1 parent 0596b84 commit a5e5a1f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Check warning on line 241 in services/kanao-gateway/src/Listeners/Caches/Guilds/GuildCreateListener.ts

View workflow job for this annotation

GitHub Actions / test / lint

Block must not be padded by blank lines

await this.store.drizzle

Check failure on line 243 in services/kanao-gateway/src/Listeners/Caches/Guilds/GuildCreateListener.ts

View workflow job for this annotation

GitHub Actions / test / lint

Expected indentation of 12 spaces but found 8
.insert(voiceStates)

Check failure on line 244 in services/kanao-gateway/src/Listeners/Caches/Guilds/GuildCreateListener.ts

View workflow job for this annotation

GitHub Actions / test / lint

Expected indentation of 16 spaces but found 12
Expand Down Expand Up @@ -269,6 +271,7 @@ export class GuildCreateListener extends Listener {
suppress: sql`EXCLUDED.suppress`
}
});
}

await this.store.amqp.publish(
RabbitMQ.GATEWAY_QUEUE_SEND,
Expand Down

0 comments on commit a5e5a1f

Please sign in to comment.