File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -304,7 +304,16 @@ export class HelpChanModule extends Module {
304
304
305
305
// Ensure they've waited long enough
306
306
// Trusted members (who aren't the asker) are allowed to disregard the timeout
307
- const askTime = msg . channel . lastPinTimestamp ?? 0 ;
307
+ const askTime = msg . channel . lastPinTimestamp ;
308
+ if ( ! askTime ) {
309
+ // This happens when the command is sent before the message is pinned
310
+ return msg . channel . send (
311
+ `:warning: Please wait a bit longer. You can ping helpers <t:${
312
+ // Not accurate, but good enough
313
+ ( Date . now ( ) + timeBeforeHelperPing ) / 1000
314
+ } :R>.`,
315
+ ) ;
316
+ }
308
317
const pingAllowedAfter = askTime + timeBeforeHelperPing ;
309
318
310
319
if ( isAsker && Date . now ( ) < pingAllowedAfter ) {
You can’t perform that action at this time.
0 commit comments