[AB-358] upgrading to JDA 5

removal of jda-utils
adding message context commands
[AB-360] fixing confirmation buttons being triggered by somebody not the author
This commit is contained in:
Sheldan
2022-02-27 23:51:06 +01:00
parent 17470f9718
commit 09450429dd
248 changed files with 2362 additions and 1482 deletions

View File

@@ -20,6 +20,7 @@ import dev.sheldan.abstracto.logging.config.LoggingPostTarget;
import dev.sheldan.abstracto.logging.model.template.MessageDeletedAttachmentLog;
import dev.sheldan.abstracto.logging.model.template.MessageDeletedLog;
import lombok.extern.slf4j.Slf4j;
import net.dv8tion.jda.api.entities.GuildMessageChannel;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.TextChannel;
import org.springframework.beans.factory.annotation.Autowired;
@@ -76,7 +77,7 @@ public class MessageDeleteLogListener implements AsyncMessageDeletedListener {
public void executeListener(CachedMessage messageFromCache, Member authorMember) {
log.debug("Message {} in channel {} in guild {} was deleted.", messageFromCache.getMessageId(), messageFromCache.getChannelId(), messageFromCache.getServerId());
TextChannel textChannel = channelService.getTextChannelFromServer(messageFromCache.getServerId(), messageFromCache.getChannelId());
GuildMessageChannel textChannel = channelService.getMessageChannelFromServer(messageFromCache.getServerId(), messageFromCache.getChannelId());
MessageDeletedLog logModel = MessageDeletedLog
.builder()
.cachedMessage(messageFromCache)

View File

@@ -17,6 +17,7 @@ import dev.sheldan.abstracto.logging.config.LoggingPostTarget;
import dev.sheldan.abstracto.logging.model.template.MessageDeletedAttachmentLog;
import dev.sheldan.abstracto.logging.model.template.MessageEditedLog;
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;
@@ -56,7 +57,7 @@ public class MessageEditedListener implements AsyncMessageUpdatedListener {
return DefaultListenerResult.IGNORED;
}
log.debug("Message {} in channel {} in guild {} was edited.", messageBefore.getMessageId(), messageBefore.getChannelId(), model.getServerId());
TextChannel textChannel = channelService.getTextChannelFromServer(model.getServerId(), messageBefore.getChannelId());
GuildMessageChannel textChannel = channelService.getMessageChannelFromServer(model.getServerId(), messageBefore.getChannelId());
MessageEditedLog lodModel = MessageEditedLog
.builder()
.messageAfter(messageAfter)