You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/modules/helpchan.ts
+45-3Lines changed: 45 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,6 @@ import {
14
14
GuildMember,
15
15
ChannelData,
16
16
CategoryChannel,
17
-
GuildManager,
18
17
Channel,
19
18
}from'discord.js';
20
19
import{HelpUser}from'../entities/HelpUser';
@@ -32,6 +31,7 @@ import {
32
31
ongoingEmptyTimeout,
33
32
trustedRoleId,
34
33
dormantChannelTimeoutHours,
34
+
timeBeforeHelperPing,
35
35
}from'../env';
36
36
import{isTrustedMember}from'../util/inhibitors';
37
37
@@ -66,13 +66,13 @@ If you want help, please ask in an available channel instead.
66
66
• Explain what you want to happen and why…
67
67
${u2800}• …and what actually happens, and your best guess at why.
68
68
• Include a short code sample and error messages, if you got any.
69
-
${u2800}• Text is better than screenshots. Start code blocks with ${'```ts'}.
69
+
${u2800}• Text is better than screenshots. Start code blocks with ${'\\`\\`\\`ts'}.
70
70
• If possible, create a minimal reproduction in the **[TypeScript Playground](https://www.typescriptlang.org/play)**.
71
71
${u2800}• Send the full link in its own message. Do not use a link shortener.
72
72
73
73
For more tips, check out StackOverflow's guide on **[asking good questions](https://stackoverflow.com/help/how-to-ask)**.
74
74
75
-
Usually someone will try to answer and help solve the issue within a few hours. If not, and **if you have followed the bullets above**, you may ping the <@&${trustedRoleId}> role. Please allow extra time at night in America/Europe.
75
+
Usually someone will try to answer and help solve the issue within a few hours. If not, and **if you have followed the bullets above**, you may ping the <@&${trustedRoleId}> role with \`!helper\`. Please allow extra time at night in America/Europe.
76
76
`;
77
77
78
78
constDORMANT_MESSAGE=`
@@ -277,6 +277,48 @@ export class HelpChanModule extends Module {
277
277
awaitmsg.delete({reason: 'Pin system message'});
278
278
}
279
279
280
+
@command({
281
+
description: 'Pings a helper in a help-channel',
282
+
aliases: ['helpers'],
283
+
})
284
+
asynchelper(msg: Message){
285
+
if(msg.channel.type!=='text')return;
286
+
if(msg.channel.parentID!==categories.ongoing){
287
+
returnmsg.channel.send(
288
+
':warning: You may only ping helpers from a help channel',
289
+
);
290
+
}
291
+
292
+
// Ensure the user has permission to ping helpers
293
+
constasker=awaitHelpUser.findOne({
294
+
channelId: msg.channel.id,
295
+
});
296
+
constisAsker=asker?.userId===msg.author.id;
297
+
constisTrusted=
298
+
(awaitisTrustedMember(msg,this.client))===undefined;// No error if trusted
299
+
if(!isAsker&&!isTrusted){
300
+
returnmsg.channel.send(
301
+
':warning: Only the asker can ping helpers',
302
+
);
303
+
}
304
+
305
+
// Ensure they've waited long enough
306
+
// Trusted members (who aren't the asker) are allowed to disregard the timeout
0 commit comments