add retention and target and change the annotation parameter to "value" for easier usage

This commit is contained in:
tueem 2024-11-06 14:43:49 +01:00
parent 7fa402ac38
commit 7d9e14eb25
Signed by: tueem
GPG Key ID: 65C8667EC17A88FB
2 changed files with 9 additions and 2 deletions

@ -1,5 +1,12 @@
package net.tomatentum.marinara.interaction.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Button {
public String customId();
public String value(); //aka customId
}

@ -34,7 +34,7 @@ public class ButtonInteractionMethod extends InteractionMethod {
private void parseMethod() {
Button button = getMethod().getAnnotation(Button.class);
this.customId = button.customId();
this.customId = button.value();
}
}