File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -128,9 +128,21 @@ client.on(GatewayDispatchEvents.ThreadCreate, async ({ data: channel }) => {
128128 return ;
129129 }
130130
131+ const receivedAt = Date . now ( ) ;
132+
131133 // Messages can only be sent after the thread starter message has arrived.
132134 // This can take substantial amounts of time after thread create in the case of large attachments
133- const collected = await waitForMessage ( channel . id , 10_000 ) . catch ( ( ) => null ) ;
135+ const collected = await waitForMessage ( channel . id , 10_000 ) . catch ( ( error : Error ) => {
136+ const failedAt = Date . now ( ) ;
137+ const failedAfterSeconds = ( failedAt - receivedAt ) / 1_000 ;
138+ logger . info (
139+ error ,
140+ `Failed while waiting for a message in channel ${ channel . id } : ${
141+ error . message
142+ } , failed after: ${ failedAfterSeconds . toFixed ( 2 ) } s`,
143+ ) ;
144+ } ) ;
145+
134146 if ( ! collected ) {
135147 return ;
136148 }
You can’t perform that action at this time.
0 commit comments