Skip to content

Kaktushose/jda-commands-inspection

Repository files navigation

Generic badge Generic badge Generic badge license-shield

JDA-Commands Inspection Plugin

IntelliJ Code Inspection Plugin for jda-commands

Example:

@Interaction
public class DynamicOptionTest {

    @SlashCommand("button test")
    public void onCommand(CommandEvent event) {
        // marked as an error, because the correct reference would be "onButton"
        event.withButtons("onClick").reply("Click me");
    }

    @Button("Click me")
    public void onButton(ComponentEvent event) {
        event.reply("You clicked me!");
    }

}

Quickfix

Quickfix options allow you to generate missing code

Before Quickfix:

@Interaction
public class DynamicOptionTest {

    @SlashCommand("button test")
    public void onCommand(CommandEvent event) {
        // marked as an error, because no method "onClick" exists yet
        event.withButtons("onClick").reply("Click me");
    }
}

After Quickfix:

@Interaction
public class DynamicOptionTest {

    @SlashCommand("button test")
    public void onCommand(CommandEvent event) {
        event.withButtons("onClick").reply("Click me");
    }

    @Button()
    public void onClick(ComponentEvent event) {

    }
}