Skip to content

Commit 34080bd

Browse files
committed
update post guidelines / htgh
1 parent d801807 commit 34080bd

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

src/modules/helpForum.ts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ import {
1313
import { sendWithMessageOwnership } from '../util/send';
1414

1515
// Use a non-breaking space to force Discord to leave empty lines alone
16-
const postGuidelines = listify(`
17-
How To Get Help
18-
- Create a new post here with your question.
16+
const postGuidelines = (here = true) =>
17+
listify(`
18+
**How To Get Help**
19+
- Create a new post ${
20+
here ? 'here' : `in <#${helpForumChannel}>`
21+
} with your question.
1922
- It's always ok to just ask your question; you don't need permission.
2023
- Someone will (hopefully!) come along and help you.
2124
\u200b
22-
How To Get Better Help
25+
**How To Get Better Help**
2326
- Explain what you want to happen and why…
2427
- …and what actually happens, and your best guess at why.
2528
- Include a short code sample and any error messages you got.
@@ -28,20 +31,20 @@ How To Get Better Help
2831
- Send the full link in its own message; do not use a link shortener.
2932
- For more tips, check out StackOverflow's guide on asking good questions: <https://stackoverflow.com/help/how-to-ask>
3033
\u200b
31-
If You Haven't Gotten Help
34+
**If You Haven't Gotten Help**
3235
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 can ping helpers by running !helper.
3336
`);
3437

3538
const howToGiveHelp = listify(`
36-
How To Give Help
39+
**How To Give Help**
3740
- The channel sidebar on the left will list threads you have joined.
3841
- You can scroll through the channel to see all recent questions.
3942
40-
How To Give *Better* Help
43+
**How To Give *Better* Help**
4144
- Get yourself the <@&${trustedRoleId}> role at <#${rolesChannelId}>
4245
- (If you don't like the pings, you can disable role mentions for the server.)
4346
44-
Useful Snippets
47+
**Useful Snippets**
4548
- \`!screenshot\` — for if an asker posts a screenshot of code
4649
- \`!ask\` — for if an asker only posts "can I get help?"
4750
`);
@@ -64,7 +67,7 @@ export async function helpForumModule(bot: Bot) {
6467
return;
6568
}
6669

67-
await forumChannel.setTopic(postGuidelines);
70+
await forumChannel.setTopic(postGuidelines());
6871

6972
bot.client.on('threadCreate', async thread => {
7073
const owner = await thread.fetchOwner();
@@ -160,7 +163,6 @@ export async function helpForumModule(bot: Bot) {
160163
bot.registerAdminCommand({
161164
aliases: ['htgh'],
162165
async listener(msg) {
163-
if (!bot.isMod(msg.member)) return;
164166
if (
165167
msg.channel.id !== howToGetHelpChannel &&
166168
msg.channel.id !== howToGiveHelpChannel
@@ -170,9 +172,10 @@ export async function helpForumModule(bot: Bot) {
170172
(await msg.channel.messages.fetch()).forEach(x => x.delete());
171173
const message =
172174
msg.channel.id === howToGetHelpChannel
173-
? postGuidelines
175+
? postGuidelines(false)
174176
: howToGiveHelp;
175-
msg.channel.send(message);
177+
// Force a blank line at the beginning of the message for compact-mode users
178+
msg.channel.send(`** **\n` + message.trim());
176179
},
177180
});
178181

0 commit comments

Comments
 (0)