[OPB-xxx] updating versions and classes

This commit is contained in:
Sheldan
2022-08-01 23:26:50 +02:00
parent 4ea878dd42
commit 4cdaf87412
8 changed files with 18 additions and 21 deletions

View File

@@ -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

View File

@@ -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))

View File

@@ -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 {

View File

@@ -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<FAQResponseModel> loadFAQResponse(String commandName, TextChannel textChannel) {
public CompletableFuture<FAQResponseModel> loadFAQResponse(String commandName, GuildMessageChannel textChannel) {
AServer server = serverManagementService.loadServer(textChannel.getGuild().getIdLong());
Optional<FAQCommand> faqCommandOptional = faqCommandManagementServiceBean.findByNameAndServer(commandName, server);
if(!faqCommandOptional.isPresent()) {

View File

@@ -14,6 +14,13 @@
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>dev.sheldan.abstracto.scheduling</groupId>
<artifactId>scheduling-int</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>

View File

@@ -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);
}

View File

@@ -38,15 +38,7 @@
<artifactId>core-int</artifactId>
</dependency>
<dependency>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>utility-int</artifactId>
</dependency>
<dependency>
<groupId>dev.sheldan.abstracto.scheduling</groupId>
<artifactId>scheduling-int</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -19,8 +19,8 @@
<maven.compiler.source>1.8</maven.compiler.source>
<!-- edit in release.yml as well -->
<!-- when releasing a new opbot version, update the .env as well-->
<abstracto.version>1.3.12</abstracto.version>
<abstracto.templates.version>1.3.0</abstracto.templates.version>
<abstracto.version>1.4.2</abstracto.version>
<abstracto.templates.version>1.4.2</abstracto.templates.version>
</properties>
<modules>