Skip to content

Commit

Permalink
Added a fix for #307 and #308
Browse files Browse the repository at this point in the history
  • Loading branch information
DxsSucuk committed Mar 6, 2023
1 parent 699f9cb commit 409a428
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/main/java/de/presti/ree6/commands/impl/mod/Setup.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void onPerform(CommandEvent commandEvent) {
optionList.add(SelectOption.of(commandEvent.getResource("label.welcomeChannel"), "welcome"));
optionList.add(SelectOption.of(commandEvent.getResource("label.autoRole"), "autorole"));
optionList.add(SelectOption.of(commandEvent.getResource("label.temporalVoice"), "tempvoice"));
optionList.add(SelectOption.of(commandEvent.getResource("label.statistics"), "statistics"));
optionList.add(SelectOption.of(commandEvent.getResource("statistics"), "statistics"));
optionList.add(SelectOption.of(commandEvent.getResource("label.ticketSystem"), "tickets"));

SelectMenu selectMenu = new StringSelectMenuImpl("setupActionMenu", commandEvent.getResource("message.setup.setupMenuPlaceholder"), 1, 1, false, optionList);
Expand Down
28 changes: 14 additions & 14 deletions src/main/java/de/presti/ree6/events/MenuEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ public void onModalInteraction(@NotNull ModalInteractionEvent event) {

String twitchUsername = modalMapping.getAsString();

java.util.List<Category> categories = event.getGuild().getCategoriesByName(LanguageService.getByGuild(event.getGuild(), "label.statistic"), true);
java.util.List<Category> categories = event.getGuild().getCategoriesByName(LanguageService.getByGuild(event.getGuild(), "statistics"), true);

Category category;

if (categories.isEmpty()) {
category = event.getGuild().createCategory(LanguageService.getByGuild(event.getGuild(), "label.statistic")).complete();
category = event.getGuild().createCategory(LanguageService.getByGuild(event.getGuild(), "statistics")).complete();
} else {
category = categories.get(0);
}
Expand Down Expand Up @@ -284,7 +284,7 @@ public void onModalInteraction(@NotNull ModalInteractionEvent event) {

String youtubeChannelName = modalMapping.getAsString();

java.util.List<Category> categories = event.getGuild().getCategoriesByName(LanguageService.getByGuild(event.getGuild(), "label.statistic"), true);
java.util.List<Category> categories = event.getGuild().getCategoriesByName(LanguageService.getByGuild(event.getGuild(), "statistics"), true);

Category category;

Expand All @@ -295,7 +295,7 @@ public void onModalInteraction(@NotNull ModalInteractionEvent event) {
.setDescription(LanguageService.getByGuild(event.getGuild(), "message.statistics.youtubeSuccess"));

if (categories.isEmpty()) {
category = event.getGuild().createCategory(LanguageService.getByGuild(event.getGuild(), "label.statistic")).complete();
category = event.getGuild().createCategory(LanguageService.getByGuild(event.getGuild(), "statistics")).complete();
} else {
category = categories.get(0);
}
Expand Down Expand Up @@ -379,7 +379,7 @@ public void onModalInteraction(@NotNull ModalInteractionEvent event) {

String subredditName = modalMapping.getAsString();

java.util.List<Category> categories = event.getGuild().getCategoriesByName(LanguageService.getByGuild(event.getGuild(), "label.statistic"), true);
java.util.List<Category> categories = event.getGuild().getCategoriesByName(LanguageService.getByGuild(event.getGuild(), "statistics"), true);

Category category;

Expand All @@ -390,7 +390,7 @@ public void onModalInteraction(@NotNull ModalInteractionEvent event) {
.setDescription(LanguageService.getByGuild(event.getGuild(), "message.statistics.redditSuccess"));

if (categories.isEmpty()) {
category = event.getGuild().createCategory(LanguageService.getByGuild(event.getGuild(), "label.statistic")).complete();
category = event.getGuild().createCategory(LanguageService.getByGuild(event.getGuild(), "statistics")).complete();
} else {
category = categories.get(0);
}
Expand Down Expand Up @@ -460,7 +460,7 @@ public void onModalInteraction(@NotNull ModalInteractionEvent event) {

String twitterName = modalMapping.getAsString();

java.util.List<Category> categories = event.getGuild().getCategoriesByName(LanguageService.getByGuild(event.getGuild(), "label.statistic"), true);
java.util.List<Category> categories = event.getGuild().getCategoriesByName(LanguageService.getByGuild(event.getGuild(), "statistics"), true);

Category category;

Expand All @@ -471,7 +471,7 @@ public void onModalInteraction(@NotNull ModalInteractionEvent event) {
.setDescription(LanguageService.getByGuild(event.getGuild(), "message.statistics.twitterSuccess"));

if (categories.isEmpty()) {
category = event.getGuild().createCategory(LanguageService.getByGuild(event.getGuild(), "label.statistic")).complete();
category = event.getGuild().createCategory(LanguageService.getByGuild(event.getGuild(), "statistics")).complete();
} else {
category = categories.get(0);
}
Expand Down Expand Up @@ -541,7 +541,7 @@ public void onModalInteraction(@NotNull ModalInteractionEvent event) {

String instagramName = modalMapping.getAsString();

java.util.List<Category> categories = event.getGuild().getCategoriesByName(LanguageService.getByGuild(event.getGuild(), "label.statistic"), true);
java.util.List<Category> categories = event.getGuild().getCategoriesByName(LanguageService.getByGuild(event.getGuild(), "statistics"), true);

Category category;

Expand All @@ -552,7 +552,7 @@ public void onModalInteraction(@NotNull ModalInteractionEvent event) {
.setDescription(LanguageService.getByGuild(event.getGuild(), "message.statistics.instagramSuccess"));

if (categories.isEmpty()) {
category = event.getGuild().createCategory(LanguageService.getByGuild(event.getGuild(), "label.statistic")).complete();
category = event.getGuild().createCategory(LanguageService.getByGuild(event.getGuild(), "statistics")).complete();
} else {
category = categories.get(0);
}
Expand Down Expand Up @@ -764,12 +764,12 @@ public void onStringSelectInteraction(@NotNull StringSelectInteractionEvent even
embedBuilder.setDescription(LanguageService.getByGuild(event.getGuild(), "message.statistics.memberSuccess"));
embedBuilder.setColor(Color.GREEN);
event.editMessageEmbeds(embedBuilder.build()).setComponents(new ArrayList<>()).queue();
java.util.List<Category> categories = event.getGuild().getCategoriesByName(LanguageService.getByGuild(event.getGuild(), "label.statistic"), true);
java.util.List<Category> categories = event.getGuild().getCategoriesByName(LanguageService.getByGuild(event.getGuild(), "statistics"), true);

Category category;

if (categories.isEmpty()) {
category = event.getGuild().createCategory(LanguageService.getByGuild(event.getGuild(), "label.statistic")).complete();
category = event.getGuild().createCategory(LanguageService.getByGuild(event.getGuild(), "statistics")).complete();
} else {
category = categories.get(0);
}
Expand All @@ -778,7 +778,7 @@ public void onStringSelectInteraction(@NotNull StringSelectInteractionEvent even
voiceChannel.getManager().setUserLimit(0).queue();
event.getGuild().createVoiceChannel(LanguageService.getByGuild(event.getGuild(), "label.realMembersName", members.stream().filter(member -> !member.getUser().isBot()).count()), category).queue(voiceChannel1 -> {
voiceChannel1.getManager().setUserLimit(0).queue();
event.getGuild().createVoiceChannel(LanguageService.getByGuild(event.getGuild(), "label.botMemberName", members.stream().filter(member -> member.getUser().isBot()).count()), category).queue(voiceChannel2 -> {
event.getGuild().createVoiceChannel(LanguageService.getByGuild(event.getGuild(), "label.botMembersName", members.stream().filter(member -> member.getUser().isBot()).count()), category).queue(voiceChannel2 -> {
voiceChannel2.getManager().setUserLimit(0).queue();
ChannelStats channelStats = SQLSession.getSqlConnector().getSqlWorker().getEntity(new ChannelStats(), "SELECT * FROM ChannelStats WHERE GID=:gid", Map.of("gid", event.getGuild().getId()));
if (channelStats != null) {
Expand Down Expand Up @@ -1253,7 +1253,7 @@ public void sendDefaultChoice(StringSelectInteractionEvent event) {
optionList.add(SelectOption.of(LanguageService.getByGuild(event.getGuild(), "label.welcomeChannel"), "welcome"));
optionList.add(SelectOption.of(LanguageService.getByGuild(event.getGuild(), "label.autoRole"), "autorole"));
optionList.add(SelectOption.of(LanguageService.getByGuild(event.getGuild(), "label.temporalVoice"), "tempvoice"));
optionList.add(SelectOption.of(LanguageService.getByGuild(event.getGuild(), "label.statistics"), "statistics"));
optionList.add(SelectOption.of(LanguageService.getByGuild(event.getGuild(), "statistics"), "statistics"));
optionList.add(SelectOption.of(LanguageService.getByGuild(event.getGuild(), "label.ticketSystem"), "tickets"));

embedBuilder.setDescription(LanguageService.getByGuild(event.getGuild(), "message.setup.setupMenu"));
Expand Down

0 comments on commit 409a428

Please sign in to comment.