@@ -47,10 +47,10 @@ public class HelpListener extends ListenerAdapter implements ButtonHandler {
4747 * A static Map that holds all messages that was sent in a specific reserved forum channel.
4848 */
4949 protected static final Map <Long , List <Message >> HELP_POST_MESSAGES = new HashMap <>();
50- private static final Set <Long > newPosts ;
50+ private static final Set <Long > newThreadChannels ;
5151
5252 static {
53- newPosts = new HashSet <>();
53+ newThreadChannels = new HashSet <>();
5454 }
5555
5656 private final BotConfig botConfig ;
@@ -62,15 +62,15 @@ public class HelpListener extends ListenerAdapter implements ButtonHandler {
6262 public void onMessageReceived (@ NotNull MessageReceivedEvent event ) {
6363 // listen for the posts initial message. Why this has to be done is further described in
6464 // https://canary.discord.com/channels/125227483518861312/1053705384466059354/1053705384466059354
65- if (newPosts .contains (event .getChannel ().getIdLong ())) {
65+ if (newThreadChannels .contains (event .getChannel ().getIdLong ())) {
6666 HelpConfig config = botConfig .get (event .getGuild ()).getHelpConfig ();
6767 ThreadChannel post = event .getChannel ().asThreadChannel ();
6868 // send post buttons
6969 post .sendMessageComponents (ActionRow .of (
7070 Button .primary (ComponentIdBuilder .build (HelpManager .HELP_CLOSE_IDENTIFIER , post .getIdLong ()), "Close Post" ),
7171 Button .secondary (ComponentIdBuilder .build (HelpManager .HELP_GUIDELINES_IDENTIFIER ), "View Help Guidelines" )
7272 )).queue (success -> post .sendMessageFormat (config .getReservedChannelMessageTemplate (), UserSnowflake .fromId (post .getOwnerId ()).getAsMention (), config .getInactivityTimeoutMinutes ()).queue ());
73- newPosts .remove (event .getChannel ().getIdLong ());
73+ newThreadChannels .remove (event .getChannel ().getIdLong ());
7474 return ;
7575 }
7676 if (event .getMessage ().getAuthor ().isSystem () || event .getMessage ().getAuthor ().isBot ()) {
@@ -105,7 +105,7 @@ public void onChannelCreate(@NotNull ChannelCreateEvent event) {
105105 }
106106 // add thread id to a temporary cache to avoid potential missing author message
107107 // more info on why this has to be done: https://canary.discord.com/channels/125227483518861312/1053705384466059354/1053705384466059354
108- newPosts .add (event .getChannel ().getIdLong ());
108+ newThreadChannels .add (event .getChannel ().getIdLong ());
109109 }
110110
111111 @ Override
0 commit comments