@@ -52,6 +52,7 @@ export const voiceOnDemand = createModule({
52
52
//NOTES: this is a potential race condition.
53
53
await cache . set ( 'lobbyIds' , [ ...lobbyIds , id ] ) ;
54
54
55
+ logger . info ( `Created voice on demand voice channel ${ id } ` ) ;
55
56
await interaction . reply ( {
56
57
content : 'Created voice on demand voice channel.' ,
57
58
ephemeral : true ,
@@ -60,7 +61,7 @@ export const voiceOnDemand = createModule({
60
61
} ,
61
62
} ,
62
63
] ,
63
- eventHandlers : ( ) => ( {
64
+ eventHandlers : ( { logger } ) => ( {
64
65
voiceStateUpdate : async ( oldState , newState ) => {
65
66
const lobbyIds = await cache . get ( 'lobbyIds' , [ ] ) ;
66
67
const onDemandChannels = await cache . get ( 'onDemandChannels' , [ ] ) ;
@@ -73,10 +74,18 @@ export const voiceOnDemand = createModule({
73
74
}
74
75
75
76
if ( isOnDemandChannel && isLeaveState ( oldState ) ) {
77
+ logger . debug (
78
+ { guild : newState . guild . id } ,
79
+ `User ${ oldState . member . displayName } left the on-demand channel` ,
80
+ ) ;
76
81
await handleLeaveOnDemand ( oldState ) ;
77
82
}
78
83
79
84
if ( isLobbyChannel && isJoinState ( newState ) ) {
85
+ logger . debug (
86
+ { guild : newState . guild . id } ,
87
+ `User ${ newState . member . displayName } joined the lobby` ,
88
+ ) ;
80
89
await handleJoinLobby ( newState ) ;
81
90
}
82
91
} ,
@@ -92,6 +101,11 @@ export const voiceOnDemand = createModule({
92
101
return ;
93
102
}
94
103
104
+ logger . info (
105
+ { guild : channel . guild . id } ,
106
+ `Voice on demand voice channel ${ channel . id } was deleted` ,
107
+ ) ;
108
+
95
109
await cache . set (
96
110
'lobbyIds' ,
97
111
lobbyIds . filter ( ( lobbyId ) => lobbyId !== channel . id ) ,
0 commit comments