package dev.nincodedo.ninbot.components.reaction;

import lombok.Data;
import lombok.NoArgsConstructor;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.MessageChannel;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;

import java.util.List;

@NoArgsConstructor
@Data
abstract class ReactionResponse {

    protected String response;
    protected String target;
    protected List<String> responses;
    protected ReactionMatchType reactionMatchType;

    public ReactionResponse(ReactionResponse reactionResponse) {
        this.response = reactionResponse.response;
        this.target = reactionResponse.target;
        this.responses = reactionResponse.responses;
        this.reactionMatchType = reactionResponse.reactionMatchType;
    }

    abstract void react(Message message, MessageChannel channel);

    boolean canRespond(MessageReceivedEvent event) {
        return switch (reactionMatchType) {
            case EXACT -> getTarget()
                    .equalsIgnoreCase(event.getMessage().getContentStripped());
            case CONTAINS -> event.getMessage()
                    .getContentStripped()
                    .toLowerCase()
                    .contains(getTarget()
                            .toLowerCase());
            case REGEX -> event.getMessage().getContentStripped().matches(getTarget());
        };
    }
}

@@ -68,41 +68,8 @@
 ta;%0A
-import lombok.NoArgsConstructor;%0A
 impo
@@ -255,41 +255,13 @@
 ;%0A%0A@
-NoArgsConstructor%0A@Data%0Aabstract 
+Data%0A
 clas
@@ -432,16 +432,55 @@
 hType;%0A%0A
+    public ReactionResponse() %7B%0A    %7D%0A%0A
     publ
@@ -771,17 +771,8 @@
     
-abstract 
 void
@@ -818,17 +818,40 @@
 channel)
-;
+ %7B%0A        //NO-OP%0A    %7D
 %0A%0A    bo

Fix loading issue for reactions