add retention and target and change the annotation parameter to "value" for easier usage
This commit is contained in:
parent
7fa402ac38
commit
7d9e14eb25
@ -1,5 +1,12 @@
|
|||||||
package net.tomatentum.marinara.interaction.annotation;
|
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 @interface Button {
|
||||||
public String customId();
|
public String value(); //aka customId
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ public class ButtonInteractionMethod extends InteractionMethod {
|
|||||||
|
|
||||||
private void parseMethod() {
|
private void parseMethod() {
|
||||||
Button button = getMethod().getAnnotation(Button.class);
|
Button button = getMethod().getAnnotation(Button.class);
|
||||||
this.customId = button.customId();
|
this.customId = button.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user