@@ -40,9 +40,6 @@ If your issue is not resolved, **you can post another message here and the threa
40
40
*If you have a different question, just ask in <#${ generalHelpChannel } >.*
41
41
` ) ;
42
42
43
- // A zero-width space (necessary to prevent discord from trimming the leading whitespace), followed by a three non-breaking spaces.
44
- const indent = '\u200b\u00a0\u00a0\u00a0' ;
45
-
46
43
const closedEmoji = '☑️' ;
47
44
48
45
const helpInfo = ( channel : TextChannel ) =>
@@ -55,29 +52,29 @@ const howToGetHelpEmbeds = () => [
55
52
. setColor ( GREEN )
56
53
. setTitle ( 'How To Get Help' )
57
54
. setDescription (
58
- `
59
- • Post your question to one of the channels in this category.
60
- ${ indent } • If you're not sure which channel is best, just post in <#${ generalHelpChannel } >.
61
- ${ indent } • It's always ok to just ask your question; you don't need permission.
62
- • Our bot will make a thread dedicated to answering your channel.
63
- • Someone will (hopefully!) come along and help you.
64
- • When your question is resolved, type \`!close\`.
65
- ` ,
55
+ listify ( `
56
+ - Post your question to one of the channels in this category.
57
+ - If you're not sure which channel is best, just post in <#${ generalHelpChannel } >.
58
+ - It's always ok to just ask your question; you don't need permission.
59
+ - Our bot will make a thread dedicated to answering your channel.
60
+ - Someone will (hopefully!) come along and help you.
61
+ - When your question is resolved, type \`!close\`.
62
+ ` ) ,
66
63
) ,
67
64
new MessageEmbed ( )
68
65
. setColor ( GREEN )
69
66
. setTitle ( 'How To Get *Better* Help' )
70
67
. setDescription (
71
- `
72
- • Explain what you want to happen and why…
73
- ${ indent } • …and what actually happens, and your best guess at why.
74
- • Include a short code sample and any error messages you got.
75
- ${ indent } • Text is better than screenshots. Start code blocks with ${ '\\`\\`\\`ts' } .
76
- • If possible, create a minimal reproduction in the **[TypeScript Playground](https://www.typescriptlang.org/play)**.
77
- ${ indent } • Send the full link in its own message; do not use a link shortener.
78
- • Run \`!title <brief description>\` to make your help thread easier to spot.
79
- • For more tips, check out StackOverflow's guide on **[asking good questions](https://stackoverflow.com/help/how-to-ask)**.
80
- ` ,
68
+ listify ( `
69
+ - Explain what you want to happen and why…
70
+ - …and what actually happens, and your best guess at why.
71
+ - Include a short code sample and any error messages you got.
72
+ - Text is better than screenshots. Start code blocks with ${ '\\`\\`\\`ts' } .
73
+ - If possible, create a minimal reproduction in the **[TypeScript Playground](https://www.typescriptlang.org/play)**.
74
+ - Send the full link in its own message; do not use a link shortener.
75
+ - Run \`!title <brief description>\` to make your help thread easier to spot.
76
+ - For more tips, check out StackOverflow's guide on **[asking good questions](https://stackoverflow.com/help/how-to-ask)**.
77
+ ` ) ,
81
78
) ,
82
79
new MessageEmbed ( )
83
80
. setColor ( GREEN )
@@ -95,38 +92,38 @@ const howToGiveHelpEmbeds = () => [
95
92
. setColor ( GREEN )
96
93
. setTitle ( 'How To Give Help' )
97
94
. setDescription (
98
- `
99
- • There are a couple ways you can browse help threads:
100
- ${ indent } • The channel sidebar on the left will list threads you have joined.
101
- ${ indent } • You can scroll through the channel to see all recent questions.
102
- ${ indent } ${ indent } • The bot will mark closed questions with ${ closedEmoji } .
103
- ${ indent } • In the channel, you can click the *⌗*\u2004icon at the top right to view threads by title.
104
-
105
- ` ,
95
+ listify ( `
96
+ - There are a couple ways you can browse help threads:
97
+ - The channel sidebar on the left will list threads you have joined.
98
+ - You can scroll through the channel to see all recent questions.
99
+ - The bot will mark closed questions with ${ closedEmoji } .
100
+ - In the channel, you can click the *⌗*\u2004icon at the top right to view threads by title.
101
+
102
+ ` ) ,
106
103
) ,
107
104
new MessageEmbed ( )
108
105
. setColor ( GREEN )
109
106
. setTitle ( 'How To Give *Better* Help' )
110
107
. setDescription (
111
- `
112
- • Get yourself the <@&${ trustedRoleId } > role at <#${ rolesChannelId } >
113
- ${ indent } • (If you don't like the pings, you can disable role mentions for the server.)
114
- • As a <@&${ trustedRoleId } >, you can:
115
- ${ indent } • Run \`!title <brief description>\` to set/update the thread title.
116
- ${ indent } ${ indent } • This will assist other helpers in finding the thread.
117
- ${ indent } ${ indent } • Also, it means your help is more accessible to others in the future.
118
- ${ indent } • If a thread appears to be resolved, run \`!close\` to close it.
119
- ${ indent } ${ indent } • *Only do this if the asker has indicated that their question has been resolved.*
120
- ` ,
108
+ listify ( `
109
+ - Get yourself the <@&${ trustedRoleId } > role at <#${ rolesChannelId } >
110
+ - (If you don't like the pings, you can disable role mentions for the server.)
111
+ - As a <@&${ trustedRoleId } >, you can:
112
+ - Run \`!title <brief description>\` to set/update the thread title.
113
+ - This will assist other helpers in finding the thread.
114
+ - Also, it means your help is more accessible to others in the future.
115
+ - If a thread appears to be resolved, run \`!close\` to close it.
116
+ - *Only do this if the asker has indicated that their question has been resolved.*
117
+ ` ) ,
121
118
) ,
122
119
new MessageEmbed ( )
123
120
. setColor ( GREEN )
124
121
. setTitle ( 'Useful Snippets' )
125
122
. setDescription (
126
- `
127
- • \`!screenshot\` — for if an asker posts a screenshot of code
128
- • \`!ask\` — for if an asker only posts "can I get help?"
129
- ` ,
123
+ listify ( `
124
+ - \`!screenshot\` — for if an asker posts a screenshot of code
125
+ - \`!ask\` — for if an asker only posts "can I get help?"
126
+ ` ) ,
130
127
) ,
131
128
] ;
132
129
@@ -413,3 +410,10 @@ export function isHelpThread(
413
410
) : channel is ThreadChannel & { parent : TextChannel } {
414
411
return channel instanceof ThreadChannel && isHelpChannel ( channel . parent ! ) ;
415
412
}
413
+
414
+ function listify ( text : string ) {
415
+ // A zero-width space (necessary to prevent discord from trimming the leading whitespace), followed by a three non-breaking spaces.
416
+ const indent = '\u200b\u00a0\u00a0\u00a0' ;
417
+ const bullet = '•' ;
418
+ return text . replace ( / ^ ( \s * ) - / gm, `$1${ bullet } ` ) . replace ( / \t / g, indent ) ;
419
+ }
0 commit comments