Skip to content

Commit 4d51ec2

Browse files
committed
Update checkEmptyOngoing to reflect occupied embed
It used to check against the available embed contents, but there's a new embed in town! We also need to check against the title now, because the occupied embed body changes depending on who claimed the channel.
1 parent 6a5cda2 commit 4d51ec2

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/modules/helpchan.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,12 @@ export class HelpChanModule extends Module {
7777
} hours of inactivity or when you send !close.`,
7878
);
7979

80+
OCCUPIED_EMBED_BASE = new MessageEmbed()
81+
.setTitle('⌛ Occupied Help Channel')
82+
.setColor(HOURGLASS_ORANGE);
83+
8084
occupiedEmbed(asker: User) {
81-
return new MessageEmbed()
82-
.setTitle('⌛ Occupied Help Channel')
83-
.setColor(HOURGLASS_ORANGE)
85+
return new MessageEmbed(this.OCCUPIED_EMBED_BASE)
8486
.setDescription(occupiedMessage(asker.tag))
8587
.setFooter(
8688
`Closes after ${
@@ -144,9 +146,8 @@ export class HelpChanModule extends Module {
144146
const embed = messages.first()?.embeds[0];
145147

146148
return (
147-
embed &&
148-
embed.description?.trim() ===
149-
this.AVAILABLE_EMBED.description?.trim()
149+
embed?.title &&
150+
embed.title.trim() === this.OCCUPIED_EMBED_BASE.title?.trim()
150151
);
151152
}
152153

@@ -451,7 +452,7 @@ export class HelpChanModule extends Module {
451452
);
452453

453454
await toPin.pin();
454-
const occupied = this.updateOccupiedEmbed(msg.author);
455+
const occupied = this.occupiedEmbed(msg.author);
455456
await this.updateStatusEmbed(claimedChannel, occupied);
456457
await this.addCooldown(member, claimedChannel);
457458
await this.moveChannel(claimedChannel, categories.ongoing);

0 commit comments

Comments
 (0)