Skip to content

Commit e9eb712

Browse files
committed
Migrate requests to forums
1 parent 8038325 commit e9eb712

File tree

7 files changed

+203
-331
lines changed

7 files changed

+203
-331
lines changed

src/commander/java/com/mcmoddev/mmdbot/commander/TheCommander.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
import com.mcmoddev.mmdbot.commander.tricks.Tricks;
5858
import com.mcmoddev.mmdbot.commander.updatenotifiers.UpdateNotifiers;
5959
import com.mcmoddev.mmdbot.commander.util.EventListeners;
60-
import com.mcmoddev.mmdbot.commander.util.ThreadChannelCreatorEvents;
6160
import com.mcmoddev.mmdbot.commander.util.mc.MCVersions;
6261
import com.mcmoddev.mmdbot.commander.util.oldchannels.OldChannelsHelper;
6362
import com.mcmoddev.mmdbot.core.bot.Bot;
@@ -445,8 +444,7 @@ record SlashCommandRegistration(Object fieldValue, RegisterSlashCommand annotati
445444
EventListeners.MISC_LISTENER.addListener(new ReferencingListener());
446445
}
447446

448-
EventListeners.MISC_LISTENER.addListeners(new ThreadListener(),
449-
new ThreadChannelCreatorEvents(this::getGeneralConfig), new FilePreviewListener());
447+
EventListeners.MISC_LISTENER.addListeners(new ThreadListener(), new FilePreviewListener());
450448

451449
COLLECT_TASKS_LISTENER.register(Events.MISC_BUS);
452450
CurseForgeCommand.RG_TASK_SCHEDULER_LISTENER.register(Events.MISC_BUS);

src/commander/java/com/mcmoddev/mmdbot/commander/commands/RoleSelectCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ public void onEvent(@NotNull final GenericEvent gE) {
393393
}
394394

395395
private void doRolePanelStuff(final GenericMessageReactionEvent event, final boolean isRemove) {
396-
if (!event.isFromGuild() || event.getUser() != null && event.getUser().isBot() || event.getUser().isSystem()) {
396+
if (!event.isFromGuild() || event.getUser() == null || event.getMember() == null || event.getUser().isBot() || event.getUser().isSystem()) {
397397
return;
398398
}
399399
final var emote = getEmoteAsString(event.getReaction());

src/commander/java/com/mcmoddev/mmdbot/commander/config/Configuration.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -131,24 +131,6 @@ public UpdateNotifiers updateNotifiers() {
131131
return updateNotifiers;
132132
}
133133

134-
@Required
135-
@Setting("requests")
136-
@Comment("The Requests channel.")
137-
private SnowflakeValue requests = SnowflakeValue.EMPTY;
138-
139-
public SnowflakeValue requests() {
140-
return requests;
141-
}
142-
143-
@Required
144-
@Setting("free_mod_ideas")
145-
@Comment("The Free Mod Ideas channel.")
146-
private SnowflakeValue freeModIdeas = SnowflakeValue.EMPTY;
147-
148-
public SnowflakeValue freeModIdeas() {
149-
return freeModIdeas;
150-
}
151-
152134
@ConfigSerializable
153135
public static final class UpdateNotifiers {
154136

src/commander/java/com/mcmoddev/mmdbot/commander/util/ThreadChannelCreatorEvents.java

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

src/watcher/java/com/mcmoddev/mmdbot/watcher/TheWatcher.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import com.mcmoddev.mmdbot.watcher.commands.moderation.UnmuteCommand;
4747
import com.mcmoddev.mmdbot.watcher.commands.moderation.WarningCommand;
4848
import com.mcmoddev.mmdbot.watcher.event.EventReactionAdded;
49+
import com.mcmoddev.mmdbot.watcher.event.ForumListener;
4950
import com.mcmoddev.mmdbot.watcher.event.PersistedRolesEvents;
5051
import com.mcmoddev.mmdbot.watcher.punishments.PunishableActions;
5152
import com.mcmoddev.mmdbot.watcher.punishments.Punishment;
@@ -282,7 +283,7 @@ public void start() {
282283
COMMANDS_LISTENER.addListener(new DismissListener());
283284

284285
MISC_LISTENER.addListener(UpdateRulesCommand::onEvent);
285-
MISC_LISTENER.addListeners(new EventReactionAdded(), new PersistedRolesEvents());
286+
MISC_LISTENER.addListeners(new EventReactionAdded(), new PersistedRolesEvents(), new ForumListener());
286287

287288
try {
288289
final var builder = JDABuilder
@@ -294,6 +295,7 @@ public void start() {
294295
.disableCache(CacheFlag.ONLINE_STATUS)
295296
.disableCache(CacheFlag.VOICE_STATE)
296297
.disableCache(CacheFlag.ACTIVITY)
298+
.enableCache(CacheFlag.FORUM_TAGS)
297299
.setEnabledIntents(INTENTS);
298300
jda = builder.build().awaitReady();
299301
} catch (final InvalidTokenException exception) {

0 commit comments

Comments
 (0)