diff --git a/LICENSE b/LICENSE index 31606f0..7398a92 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Sheldan +Copyright (c) 2022 Sheldan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/application/oneplus-bot-customizations/moderation-custom/src/main/java/dev/sheldan/oneplus/bot/custom/moderation/listener/WarningAddedListener.java b/application/oneplus-bot-customizations/moderation-custom/src/main/java/dev/sheldan/oneplus/bot/custom/moderation/listener/WarningAddedListener.java index d36d6ba..653fa27 100644 --- a/application/oneplus-bot-customizations/moderation-custom/src/main/java/dev/sheldan/oneplus/bot/custom/moderation/listener/WarningAddedListener.java +++ b/application/oneplus-bot-customizations/moderation-custom/src/main/java/dev/sheldan/oneplus/bot/custom/moderation/listener/WarningAddedListener.java @@ -19,7 +19,7 @@ import dev.sheldan.oneplus.bot.custom.moderation.config.ModerationCustomFeatureD import dev.sheldan.oneplus.bot.custom.moderation.config.ModerationCustomPostTarget; import dev.sheldan.oneplus.bot.custom.moderation.model.template.WarningThresholdNotificationModel; import lombok.extern.slf4j.Slf4j; -import net.dv8tion.jda.api.entities.TextChannel; +import net.dv8tion.jda.api.entities.GuildMessageChannel; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -71,7 +71,7 @@ public class WarningAddedListener implements WarningCreatedListener { Long channelId = model.getWarningChannelId(); Long warnedUserId = model.getWarnedUserId(); - TextChannel channel = channelService.getTextChannelFromServer(serverId, channelId); + GuildMessageChannel channel = channelService.getMessageChannelFromServer(serverId, channelId); WarningThresholdNotificationModel notificationModel = WarningThresholdNotificationModel .builder() .channelDisplay(ChannelDisplay.fromChannel(channel)) diff --git a/application/oneplus-bot-modules/faq/src/main/java/dev/sheldan/oneplus/bot/modules/faq/command/FAQ.java b/application/oneplus-bot-modules/faq/src/main/java/dev/sheldan/oneplus/bot/modules/faq/command/FAQ.java index 9bd1fd8..53f8e30 100644 --- a/application/oneplus-bot-modules/faq/src/main/java/dev/sheldan/oneplus/bot/modules/faq/command/FAQ.java +++ b/application/oneplus-bot-modules/faq/src/main/java/dev/sheldan/oneplus/bot/modules/faq/command/FAQ.java @@ -17,6 +17,7 @@ import dev.sheldan.oneplus.bot.modules.faq.config.FAQFeatureDefinition; import dev.sheldan.oneplus.bot.modules.faq.config.FAQModuleDefinition; import dev.sheldan.oneplus.bot.modules.faq.models.command.faq.FAQResponseModel; import dev.sheldan.oneplus.bot.modules.faq.service.FAQResponseServiceBean; +import net.dv8tion.jda.api.entities.GuildMessageChannel; import net.dv8tion.jda.api.entities.TextChannel; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -50,7 +51,7 @@ public class FAQ extends AbstractConditionableCommand { String commandName; if(!parameters.isEmpty()) { commandName = (String) parameters.get(0); - TextChannel channel; + GuildMessageChannel channel; if (parameters.size() == 2) { channel = (TextChannel) parameters.get(1); } else { diff --git a/application/oneplus-bot-modules/faq/src/main/java/dev/sheldan/oneplus/bot/modules/faq/service/FAQResponseServiceBean.java b/application/oneplus-bot-modules/faq/src/main/java/dev/sheldan/oneplus/bot/modules/faq/service/FAQResponseServiceBean.java index 78ab7ca..1d85eab 100644 --- a/application/oneplus-bot-modules/faq/src/main/java/dev/sheldan/oneplus/bot/modules/faq/service/FAQResponseServiceBean.java +++ b/application/oneplus-bot-modules/faq/src/main/java/dev/sheldan/oneplus/bot/modules/faq/service/FAQResponseServiceBean.java @@ -22,10 +22,7 @@ import dev.sheldan.oneplus.bot.modules.faq.service.management.FAQChannelGroupCom import dev.sheldan.oneplus.bot.modules.faq.service.management.FAQCommandAliasManagementService; import dev.sheldan.oneplus.bot.modules.faq.service.management.FAQCommandManagementServiceBean; import lombok.extern.slf4j.Slf4j; -import net.dv8tion.jda.api.entities.ISnowflake; -import net.dv8tion.jda.api.entities.SelfUser; -import net.dv8tion.jda.api.entities.TextChannel; -import net.dv8tion.jda.api.entities.User; +import net.dv8tion.jda.api.entities.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -67,7 +64,7 @@ public class FAQResponseServiceBean { @Autowired private FAQResponseServiceBean self; - public CompletableFuture loadFAQResponse(String commandName, TextChannel textChannel) { + public CompletableFuture loadFAQResponse(String commandName, GuildMessageChannel textChannel) { AServer server = serverManagementService.loadServer(textChannel.getGuild().getIdLong()); Optional faqCommandOptional = faqCommandManagementServiceBean.findByNameAndServer(commandName, server); if(!faqCommandOptional.isPresent()) { diff --git a/application/oneplus-bot-modules/news/pom.xml b/application/oneplus-bot-modules/news/pom.xml index 7e7ee04..d8a04d4 100644 --- a/application/oneplus-bot-modules/news/pom.xml +++ b/application/oneplus-bot-modules/news/pom.xml @@ -14,6 +14,13 @@ 8 + + + dev.sheldan.abstracto.scheduling + scheduling-int + + + diff --git a/application/oneplus-bot-modules/news/src/main/java/dev/sheldan/oneplus/bot/modules/news/service/NewsServiceBean.java b/application/oneplus-bot-modules/news/src/main/java/dev/sheldan/oneplus/bot/modules/news/service/NewsServiceBean.java index 6c56931..67c847e 100644 --- a/application/oneplus-bot-modules/news/src/main/java/dev/sheldan/oneplus/bot/modules/news/service/NewsServiceBean.java +++ b/application/oneplus-bot-modules/news/src/main/java/dev/sheldan/oneplus/bot/modules/news/service/NewsServiceBean.java @@ -11,8 +11,8 @@ import dev.sheldan.oneplus.bot.modules.news.model.NewsMessageModel; import dev.sheldan.oneplus.bot.modules.news.model.database.NewsPost; import dev.sheldan.oneplus.bot.modules.news.service.management.NewsPostManagementServiceBean; import lombok.extern.slf4j.Slf4j; +import net.dv8tion.jda.api.entities.GuildMessageChannel; import net.dv8tion.jda.api.entities.Message; -import net.dv8tion.jda.api.entities.TextChannel; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @@ -113,7 +113,7 @@ public class NewsServiceBean { log.info("Updating news post {} with new content based on message from user {} in server {}.", newsPost.getSourceMessageId(), updatedMessage.getIdLong(), updatedMessage.getGuild().getId()); MessageToSend messageToSend = templateService.renderEmbedTemplate(MESSAGE_TEMPLATE_KEY, model, serverId); - TextChannel newsChannel = channelService.getTextChannelFromServer(serverId, newsPost.getNewsChannel().getId()); + GuildMessageChannel newsChannel = channelService.getMessageChannelFromServer(serverId, newsPost.getNewsChannel().getId()); return channelService.editMessageInAChannelFuture(messageToSend, newsChannel, newsPost.getNewsMessageId()) .thenApply(message -> null); } diff --git a/application/pom.xml b/application/pom.xml index 8c12970..65148cf 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -38,15 +38,7 @@ core-int - - dev.sheldan.abstracto.modules - utility-int - - - dev.sheldan.abstracto.scheduling - scheduling-int - \ No newline at end of file diff --git a/pom.xml b/pom.xml index 41b7957..04487c0 100644 --- a/pom.xml +++ b/pom.xml @@ -19,8 +19,8 @@ 1.8 - 1.3.12 - 1.3.0 + 1.4.2 + 1.4.2