@@ -290,13 +290,13 @@ export class HelpChanModule extends Module {
290
290
}
291
291
292
292
// Ensure the user has permission to ping helpers
293
- const owner = await HelpUser . findOne ( {
293
+ const asker = await HelpUser . findOne ( {
294
294
channelId : msg . channel . id ,
295
295
} ) ;
296
- const isOwner = owner ?. userId === msg . author . id ;
296
+ const isAsker = asker ?. userId === msg . author . id ;
297
297
const isTrusted =
298
298
( await isTrustedMember ( msg , this . client ) ) === undefined ; // No error if trusted
299
- if ( ! isOwner && ! isTrusted ) {
299
+ if ( ! isAsker && ! isTrusted ) {
300
300
return msg . channel . send (
301
301
':warning: Only the asker can ping helpers' ,
302
302
) ;
@@ -305,14 +305,13 @@ export class HelpChanModule extends Module {
305
305
// Ensure they've waited long enough
306
306
// Trusted members (who aren't the asker) are allowed to disregard the timeout
307
307
const askTime = msg . channel . lastPinTimestamp ?? 0 ;
308
- const timeToWait = timeBeforeHelperPing - ( Date . now ( ) - askTime ) ;
308
+ const pingAllowedAfter = askTime + timeBeforeHelperPing ;
309
309
310
- if ( isOwner && timeToWait > 0 ) {
311
- const minutesToWait = Math . round ( timeToWait / ( 60 * 1000 ) ) ;
310
+ if ( isAsker && Date . now ( ) < pingAllowedAfter ) {
312
311
return msg . channel . send (
313
- `:warning: Please wait at least ${ minutesToWait } minute ${
314
- minutesToWait === 1 ? '' : 's'
315
- } before attempting to ping helpers `,
312
+ `:warning: Please wait a bit longer. You can ping helpers <t: ${
313
+ pingAllowedAfter / 1000
314
+ } :R>. `,
316
315
) ;
317
316
}
318
317
0 commit comments