Annotation Interface Plugin


@Retention(RUNTIME) @Target(TYPE) public @interface Plugin
Marks a class as a Pudel plugin. Similar to Spring's @Controller or @Service annotations.

Example:

@Plugin(
    name = "MyPlugin",
    version = "1.0.0",
    author = "Developer",
    description = "A sample plugin"
)
public class MyPlugin {

    @SlashCommand(name = "ping", description = "Check bot latency")
    public void ping(SlashCommandInteractionEvent event) {
        event.reply("Pong!").queue();
    }

    @TextCommand("hello")
    public void hello(CommandContext ctx) {
        ctx.reply("Hello, " + ctx.getUser().getName() + "!");
    }
}

The core will automatically:

  • Discover annotated methods
  • Register commands on enable
  • Unregister commands on disable
  • Sync slash commands to Discord
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Returns the name of the plugin.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Returns the author of the plugin.
    Returns the description of the plugin.
    Returns the version of the plugin.
  • Element Details

    • name

      String name
      Returns the name of the plugin.
      Returns:
      the name of the plugin as a String
    • version

      String version
      Returns the version of the plugin.
      Returns:
      the version of the plugin as a String, defaults to "1.0.0"
      Default:
      "1.0.0"
    • author

      String author
      Returns the author of the plugin.
      Returns:
      the author of the plugin as a String, defaults to an empty string
      Default:
      ""
    • description

      String description
      Returns the description of the plugin.
      Returns:
      the description of the plugin as a String, defaults to an empty string
      Default:
      ""