Annotation 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 -
Optional Element Summary
Optional Elements
-
Element Details
-
name
-
version
String versionReturns 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 authorReturns the author of the plugin.- Returns:
- the author of the plugin as a String, defaults to an empty string
- Default:
""
-
description
String descriptionReturns the description of the plugin.- Returns:
- the description of the plugin as a String, defaults to an empty string
- Default:
""
-