Skip to content

Commit 2def9e0

Browse files
committed
Add "occupied help channel" embed
https://discord.com/channels/508357248330760243/508357683506708514/821851432235433984 ^As @gencha#69 points out, once a channel has been claimed, there's still a big 'ol embed just a little ways up that describes the channel as available -- which might contribute to help-channel sniping. This adds a new embed which marks the channel as occupied. It does not use it anywhere yet; that'll come soon.
1 parent 02393ca commit 2def9e0

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/env.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ export const ongoingEmptyTimeout = parseInt(process.env.ONGOING_EMPTY_TIMEOUT!);
3838

3939
export const TS_BLUE = '#007ACC';
4040
export const GREEN = '#77b155';
41+
// Picked from Discord's "hourglass" emoji (in ⌛ | Occupied Help Channels)
42+
export const HOURGLASS_ORANGE = '#ffa647';

src/modules/helpchan.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ import {
1212
Guild,
1313
TextChannel,
1414
GuildMember,
15+
User,
1516
} from 'discord.js';
1617
import { HelpUser } from '../entities/HelpUser';
1718
import {
1819
categories,
1920
TS_BLUE,
2021
GREEN,
22+
HOURGLASS_ORANGE,
2123
askCooldownRoleId,
2224
channelNames,
2325
dormantChannelTimeout,
@@ -39,6 +41,19 @@ This channel will be dedicated to answering your question only. Others will try
3941
For more tips, check out StackOverflow's guide on **[asking good questions](https://stackoverflow.com/help/how-to-ask)**.
4042
`;
4143

44+
const occupiedMessage = (tag: string) => `
45+
**This channel is claimed by @${tag}**
46+
47+
This channel is dedicated to answering their question only (and any of their follow-up questions). Others will try to answer and help solve the issue.
48+
49+
**To @${tag}, keep in mind:**
50+
• It's always ok to just ask your question. You don't need permission.
51+
• Explain what you expect to happen and what actually happens.
52+
• Include a code sample and error message, if you got any.
53+
54+
For more tips, check out StackOverflow's guide on **[asking good questions](https://stackoverflow.com/help/how-to-ask)**.
55+
`;
56+
4257
const DORMANT_MESSAGE = `
4358
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.
4459
@@ -62,6 +77,18 @@ export class HelpChanModule extends Module {
6277
} hours of inactivity or when you send !close.`,
6378
);
6479

80+
occupiedEmbed(asker: User) {
81+
return new MessageEmbed()
82+
.setTitle('⌛ Occupied Help Channel')
83+
.setColor(HOURGLASS_ORANGE)
84+
.setDescription(occupiedMessage(asker.tag))
85+
.setFooter(
86+
`Closes after ${
87+
dormantChannelTimeout / 60 / 60 / 1000
88+
} hours of inactivity or when ${asker.username} sends !close.`,
89+
);
90+
}
91+
6592
DORMANT_EMBED = new MessageEmbed()
6693
.setColor(TS_BLUE)
6794
.setDescription(DORMANT_MESSAGE);

0 commit comments

Comments
 (0)