Skip to content

Commit 3907c21

Browse files
committed
extract into template literals
1 parent aad5f86 commit 3907c21

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

src/modules/helpchan.ts

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,24 @@ import {
2626
} from '../env';
2727
import { isTrustedMember } from '../util/inhibitors';
2828

29+
const AVAILABLE_MESSAGE = `
30+
✅ **Send your question here to claim the channel**
31+
This channel will be dedicated to answering your question only. Others will try to answer and help you solve the issue.
32+
33+
**Keep in mind:**
34+
• It's always ok to just ask your question. You don't need permission.
35+
• Explain what you expect to happen and what actually happens.
36+
• Include a code sample and error message, if you got any.
37+
38+
For more tips, check out StackOverflow's guide on **[asking good questions](https://stackoverflow.com/help/how-to-ask)**.
39+
`;
40+
41+
const DORMANT_MESSAGE = `
42+
This help channel has been marked as **dormant**, and has been moved into the **Help: Dormant** category at the bottom of the channel list. It is no longer possible to send messages in this channel until it becomes available again.
43+
44+
If your question wasn't answered yet, you can claim a new help channel from the **Help: Available** category by simply asking your question again. Consider rephrasing the question to maximize your chance of getting a good answer. If you're not sure how, have a look through [StackOverflow's guide on asking a good question](https://stackoverflow.com/help/how-to-ask)
45+
`;
46+
2947
export class HelpChanModule extends Module {
3048
constructor(client: CookiecordClient) {
3149
super(client);
@@ -35,26 +53,11 @@ export class HelpChanModule extends Module {
3553

3654
AVAILABLE_EMBED = new MessageEmbed()
3755
.setColor(GREEN)
38-
.setDescription(
39-
'✅ **Send your question here to claim the channel**\n' +
40-
'This channel will be dedicated to answering your question only. Others will try to answer and help you solve the issue.\n\n' +
41-
'**Keep in mind:**\n' +
42-
"• It's always ok to just ask your question. You don't need permission.\n" +
43-
'• Explain what you expect to happen and what actually happens.\n' +
44-
'• Include a code sample and error message, if you got any.\n\n' +
45-
"For more tips, check out StackOverflow's guide on **[asking good questions](https://stackoverflow.com/help/how-to-ask)**.",
46-
);
56+
.setDescription(AVAILABLE_MESSAGE);
4757

4858
DORMANT_EMBED = new MessageEmbed()
4959
.setColor(TS_BLUE)
50-
.setDescription(
51-
'This help channel has been marked as **dormant**, and has been moved into the **Help: Dormant** category at the ' +
52-
'bottom of the channel list. It is no longer possible to send messages in this channel until it becomes available again.\n\n' +
53-
"If your question wasn't answered yet, you can claim a new help channel from the **Help: Available** category" +
54-
' by simply asking your question again. Consider rephrasing the question to maximize your chance of getting ' +
55-
"a good answer. If you're not sure how, have a look through " +
56-
"[StackOverflow's guide on asking a good question](https://stackoverflow.com/help/how-to-ask)",
57-
);
60+
.setDescription(DORMANT_MESSAGE);
5861

5962
busyChannels: Set<string> = new Set(); // a lock to eliminate race conditions
6063

0 commit comments

Comments
 (0)