File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 3333 "scripts" : {
3434 "start" : " ts-node-dev --respawn src" ,
3535 "build" : " tsc" ,
36- "lint" : " prettier --check ' src/**/*.ts' " ,
37- "lint:fix" : " prettier ' src/**/*.ts' --write "
36+ "lint" : " prettier --check src/**/*.ts" ,
37+ "lint:fix" : " prettier src/**/*.ts --write "
3838 }
3939}
Original file line number Diff line number Diff line change @@ -177,10 +177,17 @@ export class HelpChanModule extends Module {
177177 if ( dormant && dormant instanceof TextChannel ) {
178178 await this . moveChannel ( dormant , categories . ask ) ;
179179
180- const lastMessage = dormant . messages . cache
180+ let lastMessage = dormant . messages . cache
181181 . array ( )
182182 . reverse ( )
183183 . find ( m => m . author . id === this . client . user ?. id ) ;
184+
185+ if ( ! lastMessage )
186+ lastMessage = ( await dormant . messages . fetch ( { limit : 5 } ) )
187+ . array ( )
188+ . reverse ( )
189+ . find ( m => m . author . id === this . client . user ?. id ) ;
190+
184191 if ( lastMessage ) {
185192 // If there is a last message (the dormant message) by the bot, just edit it
186193 await lastMessage . edit ( this . AVAILABLE_EMBED ) ;
You can’t perform that action at this time.
0 commit comments