File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
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 @@ -60,7 +60,7 @@ export class HelpChanModule extends Module {
6060
6161 private getChannelName ( guild : Guild ) {
6262 const takenChannelNames = guild . channels . cache
63- . filter ( channel => channel . name . startsWith ( 'help-' ) )
63+ . filter ( channel => channel . name . startsWith ( this . CHANNEL_PREFIX ) )
6464 . map ( channel => channel . name . replace ( this . CHANNEL_PREFIX , '' ) ) ;
6565 let decidedChannel = channelNames [ 0 ] ;
6666
@@ -174,10 +174,16 @@ export class HelpChanModule extends Module {
174174 if ( dormant && dormant instanceof TextChannel ) {
175175 await this . moveChannel ( dormant , categories . ask ) ;
176176
177- const lastMessage = dormant . messages . cache
177+ let lastMessage = dormant . messages . cache
178178 . array ( )
179179 . reverse ( )
180180 . find ( m => m . author . id === this . client . user ?. id ) ;
181+
182+ if ( ! lastMessage )
183+ lastMessage = ( await dormant . messages . fetch ( { limit : 5 } ) )
184+ . array ( )
185+ . find ( m => m . author . id === this . client . user ?. id ) ;
186+
181187 if ( lastMessage ) {
182188 // If there is a last message (the dormant message) by the bot, just edit it
183189 await lastMessage . edit ( this . AVAILABLE_EMBED ) ;
You can’t perform that action at this time.
0 commit comments