Skip to content

HelpThreadCreatedListener#sendHelperHeadsUp only pings a single category role #854

@Nxllpointer

Description

@Nxllpointer

This bug was probably introduced while switching over from the thread-based help system to the forum, as the threads could only be assigned a single category. The forum posts however can have multiple tags and so all category roles should be pinged accordingly, not just one, as you might not get added to a forum post which you subscribed to.

Responsible code in HelpThreadCreatedListener#sendHelperHeadsUp:

String helperMention = helper.getCategoryTagOfChannel(threadChannel)
.map(ForumTag::getName)
.flatMap(category -> helper.handleFindRoleForCategory(category,
threadChannel.getGuild()))
.map(Role::getAsMention)
.orElse(alternativeMention);
// We want to invite all members of a role, but without hard-pinging them. However,
// manually inviting them is cumbersome and can hit rate limits.
// Instead, we abuse the fact that a role-ping through an edit will not hard-ping users,
// but still invite them to a thread.
String headsUpPattern = "%s please have a look, thanks.";
String headsUpWithoutRole = headsUpPattern.formatted(alternativeMention);
String headsUpWithRole = headsUpPattern.formatted(helperMention);

This would need to be changed to support multiple category roles and a new method in HelpSystemHelper must be added to get all categories of the post.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions