Skip to content

Commit 6b97abf

Browse files
authored
Merge pull request #105 from typescript-community/new-available-embed
New available embed
2 parents e38dcf7 + 5df6377 commit 6b97abf

File tree

6 files changed

+24
-135
lines changed

6 files changed

+24
-135
lines changed

src/db.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Connection, createConnection } from 'typeorm';
22
import { dbUrl } from './env';
3-
import { Reminder } from './entities/Reminder';
43
import { RepUser } from './entities/RepUser';
54
import { RepGive } from './entities/RepGive';
65
import { HelpUser } from './entities/HelpUser';
@@ -14,7 +13,7 @@ export async function getDB() {
1413
url: dbUrl,
1514
synchronize: true,
1615
logging: false,
17-
entities: [Reminder, RepUser, RepGive, HelpUser],
16+
entities: [RepUser, RepGive, HelpUser],
1817
});
1918
console.log('Connected to DB');
2019
return db;

src/entities/Reminder.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/env.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ export const dormantChannelTimeout = parseInt(
3333
);
3434
export const dormantChannelLoop = parseInt(process.env.DORMANT_CHANNEL_LOOP!);
3535
export const TS_BLUE = '#007ACC';
36+
export const GREEN = '#77b155';

src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { AutoroleModule } from './modules/autorole';
77
import { EtcModule } from './modules/etc';
88
import { HelpChanModule } from './modules/helpchan';
99
import { PlaygroundModule } from './modules/playground';
10-
import { ReminderModule } from './modules/reminders';
1110
import { RepModule } from './modules/rep';
1211
import { TwoslashModule } from './modules/twoslash';
1312
import { HelpModule } from './modules/help';
@@ -28,7 +27,6 @@ for (const mod of [
2827
EtcModule,
2928
HelpChanModule,
3029
PlaygroundModule,
31-
ReminderModule,
3230
RepModule,
3331
TwoslashModule,
3432
HelpModule,

src/modules/helpchan.ts

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { HelpUser } from '../entities/HelpUser';
1717
import {
1818
categories,
1919
TS_BLUE,
20+
GREEN,
2021
askCooldownRoleId,
2122
channelNames,
2223
dormantChannelTimeout,
@@ -25,6 +26,24 @@ import {
2526
} from '../env';
2627
import { isTrustedMember } from '../util/inhibitors';
2728

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+
2847
export class HelpChanModule extends Module {
2948
constructor(client: CookiecordClient) {
3049
super(client);
@@ -33,28 +52,12 @@ export class HelpChanModule extends Module {
3352
CHANNEL_PREFIX = 'help-';
3453

3554
AVAILABLE_EMBED = new MessageEmbed()
36-
.setColor(TS_BLUE)
37-
.setDescription(
38-
'This help channel is now **available**, which means that ' +
39-
'you can claim it by typing your question into it. ' +
40-
'Once claimed, the channel will move into the **Help: Ongoing** category, and ' +
41-
`will be yours until it has been inactive for ${
42-
dormantChannelTimeout / 60 / 60
43-
} hours or is closed ` +
44-
'manually with `!close`. When that happens, it will be set to **dormant** and moved into the **Help: Dormant** category.\n\n' +
45-
"Try to write the best question you can by providing a detailed description and telling us what you've tried already.",
46-
);
55+
.setColor(GREEN)
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

src/modules/reminders.ts

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)