We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3bef73d commit e8acb3aCopy full SHA for e8acb3a
1 file changed
src/events/interactionCreate.ts
@@ -1033,10 +1033,17 @@ export default {
1033
1034
// Send webhook notification for each queue left
1035
// Just do the first queue listed, multi-queue support later
1036
- sendWebhook('LEAVE_QUEUE', {
1037
- players_removed: [{ id: interaction.user.id }],
1038
- queueId: userQueuesBeforeLeave[0].id,
1039
- })
+ const firstQueueLeft = userQueuesBeforeLeave[0]
+ if (firstQueueLeft) {
+ sendWebhook('LEAVE_QUEUE', {
+ players_removed: [{ id: interaction.user.id }],
1040
+ queueId: firstQueueLeft.id,
1041
+ })
1042
+ } else {
1043
+ console.warn(
1044
+ `[LEAVE_QUEUE] No queued rows found before leave for user ${interaction.user.id}`,
1045
+ )
1046
+ }
1047
1048
let message = 'You left the queue!'
1049
0 commit comments