Skip to content

Commit

Permalink
Fix commands with alias and subcommands (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pugzy authored Mar 21, 2023
1 parent efc97cb commit 504e4fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/main/java/tc/oc/occ/cheaty/commands/AdminCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Dependency;
import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.Subcommand;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import tc.oc.occ.cheaty.Cheaty;

@CommandAlias("cheaty")
public class AdminCommands extends BaseCommand {

@Dependency private Cheaty plugin;

@CommandAlias("cheaty")
@Subcommand("reload")
@Description("Reload cheaty config")
@CommandPermission("cheaty.admin")
public void reload(CommandSender sender) {
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/tc/oc/occ/cheaty/commands/BotCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Dependency;
import co.aikar.commands.annotation.Subcommand;
import co.aikar.commands.annotation.Syntax;
import org.bukkit.command.CommandSender;
import tc.oc.occ.cheaty.DiscordBot;
import tc.oc.occ.cheaty.DiscordBot.RelayType;

@CommandAlias("cheaty")
public class BotCommands extends BaseCommand {

@Dependency private DiscordBot bot;

@CommandAlias("relay")
@Subcommand("relay")
@Syntax("[message] - Message to relay to discord")
@CommandPermission("cheaty.bot")
public void relay(CommandSender sender, String message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Dependency;
import co.aikar.commands.annotation.Subcommand;
import co.aikar.commands.annotation.Syntax;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
Expand All @@ -26,12 +27,13 @@
import tc.oc.pgm.util.named.NameStyle;
import tc.oc.pgm.util.text.TextTranslations;

@CommandAlias("cheaty")
public class CheatNotifyCommand extends BaseCommand {

@Dependency private BotConfig config;
@Dependency private DiscordBot bot;

@CommandAlias("cheaty notify")
@Subcommand("notify")
@Syntax("[player] [message]")
@CommandPermission("cheaty.notify")
public void notify(CommandSender sender, String target, String message) {
Expand Down

0 comments on commit 504e4fb

Please sign in to comment.