[AB-xxx] adding ability to automate giveaways using modmail and adding storage for give away keys

ignoring message updated events for messages not within servers
This commit is contained in:
Sheldan
2024-12-25 19:54:24 +01:00
parent 8819c12b81
commit cdbdb395ac
38 changed files with 1266 additions and 87 deletions

View File

@@ -0,0 +1,13 @@
package dev.sheldan.abstracto.modmail.model.listener;
import dev.sheldan.abstracto.core.templating.model.MessageToSend;
import lombok.Builder;
import lombok.Getter;
@Builder
@Getter
public class ModmailThreadCreatedSendMessageModel {
private MessageToSend messageToSend;
private Long serverId;
private Long userId;
}

View File

@@ -5,6 +5,7 @@ import dev.sheldan.abstracto.core.models.UndoActionInstance;
import dev.sheldan.abstracto.core.models.database.AChannel;
import dev.sheldan.abstracto.core.models.database.AUser;
import dev.sheldan.abstracto.core.models.database.AUserInAServer;
import dev.sheldan.abstracto.core.templating.model.MessageToSend;
import dev.sheldan.abstracto.modmail.model.ClosingContext;
import dev.sheldan.abstracto.modmail.model.database.ModMailThread;
import net.dv8tion.jda.api.entities.*;
@@ -62,6 +63,7 @@ public interface ModMailThreadService {
* @return A {@link CompletableFuture future} which completes when the message has been relayed to the channel
*/
CompletableFuture<Message> relayMessageToModMailThread(ModMailThread modMailThread, Message messageFromUser, List<UndoActionInstance> undoActions);
CompletableFuture<Void> sendMessageToUser(AUserInAServer aUserInAServer, MessageToSend messageToSend, User user);
/**
* Forwards a message send by a moderator to the direct message channel opened with the user. If the message is

View File

@@ -17,13 +17,13 @@ public interface ModMailMessageManagementService {
* @param modMailThread The {@link ModMailThread} the message should be attached to
* @param createdMessageInDM The {@link Message} which should be attached to the {@link ModMailThread} and was posted to the DM channel (might be null)
* @param createdMessageInChannel The {@link Message} which should be attached to the {@link ModMailThread} and was posted to the modmail thread (might be null)
* @param userPostedMessage The {@link Message} which caused this message to be created, the command or the message by the user
* @param messageId The ID of the {@link Message} which caused this message to be created, the command or the message by the user
* @param author The {@link AUserInAServer} who authored the {@link Message} originally
* @param anonymous Whether or not the message was sent anonymous (only possible by staff members)
* @param dmChannel Whether or not the message originated from the user, and therefore in an direct message channel
* @return The created {@link ModMailMessage message} instance
*/
ModMailMessage addMessageToThread(ModMailThread modMailThread, Message createdMessageInDM, Message createdMessageInChannel, Message userPostedMessage, AUserInAServer author, Boolean anonymous, Boolean dmChannel);
ModMailMessage addMessageToThread(ModMailThread modMailThread, Message createdMessageInDM, Message createdMessageInChannel, Long messageId, AUserInAServer author, Boolean anonymous, Boolean dmChannel);
/**
* Retrieves all messages which were sent in a {@link ModMailThread}