From 72f9bb4eb5787974f295c5c9cce18db47213d1c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Tue, 20 Dec 2022 17:18:24 +0100 Subject: [PATCH] Make command category not null --- src/main/java/wtf/beatrice/hidekobot/HidekoBot.java | 1 + .../java/wtf/beatrice/hidekobot/commands/base/MagicBall.java | 2 +- .../wtf/beatrice/hidekobot/commands/message/AvatarCommand.java | 2 ++ .../wtf/beatrice/hidekobot/commands/message/BotInfoCommand.java | 2 ++ .../wtf/beatrice/hidekobot/commands/message/ClearCommand.java | 2 ++ .../beatrice/hidekobot/commands/message/CoinFlipCommand.java | 2 ++ .../beatrice/hidekobot/commands/message/DiceRollCommand.java | 2 ++ .../wtf/beatrice/hidekobot/commands/message/HelloCommand.java | 2 ++ .../wtf/beatrice/hidekobot/commands/message/HelpCommand.java | 2 ++ .../wtf/beatrice/hidekobot/commands/message/InviteCommand.java | 2 ++ .../hidekobot/commands/message/LoveCalculatorCommand.java | 2 ++ .../beatrice/hidekobot/commands/message/MagicBallCommand.java | 2 ++ .../wtf/beatrice/hidekobot/commands/message/SayCommand.java | 2 ++ .../hidekobot/commands/message/UrbanDictionaryCommand.java | 2 ++ .../wtf/beatrice/hidekobot/objects/commands/MessageCommand.java | 2 ++ 15 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/main/java/wtf/beatrice/hidekobot/HidekoBot.java b/src/main/java/wtf/beatrice/hidekobot/HidekoBot.java index f4c8770..717a925 100644 --- a/src/main/java/wtf/beatrice/hidekobot/HidekoBot.java +++ b/src/main/java/wtf/beatrice/hidekobot/HidekoBot.java @@ -131,6 +131,7 @@ public class HidekoBot // register message commands MessageCommandListener messageCommandListener = new MessageCommandListener(); messageCommandListener.registerCommand(new HelloCommand()); + messageCommandListener.registerCommand(new wtf.beatrice.hidekobot.commands.message.AliasCommand()); messageCommandListener.registerCommand(new wtf.beatrice.hidekobot.commands.message.AvatarCommand()); messageCommandListener.registerCommand(new wtf.beatrice.hidekobot.commands.message.BotInfoCommand()); messageCommandListener.registerCommand(new wtf.beatrice.hidekobot.commands.message.CoinFlipCommand()); diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/base/MagicBall.java b/src/main/java/wtf/beatrice/hidekobot/commands/base/MagicBall.java index 7d47ca8..8678ed1 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/base/MagicBall.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/base/MagicBall.java @@ -16,7 +16,7 @@ public class MagicBall public static LinkedList getLabels() { - return new LinkedList<>(Arrays.asList("8ball", "eightball", "magicball", "8b")); + return new LinkedList<>(Arrays.asList("8ball", "8b", "eightball", "magicball")); } private final static List answers = new ArrayList<>( diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/message/AvatarCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/message/AvatarCommand.java index 2ea997d..8f89d54 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/message/AvatarCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/message/AvatarCommand.java @@ -5,6 +5,7 @@ import net.dv8tion.jda.api.entities.Mentions; import net.dv8tion.jda.api.entities.MessageEmbed; import net.dv8tion.jda.api.entities.User; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import wtf.beatrice.hidekobot.Cache; import wtf.beatrice.hidekobot.HidekoBot; @@ -35,6 +36,7 @@ public class AvatarCommand implements MessageCommand return false; } + @NotNull @Override public CommandCategory getCategory() { return CommandCategory.TOOLS; diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/message/BotInfoCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/message/BotInfoCommand.java index 233c539..6a22880 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/message/BotInfoCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/message/BotInfoCommand.java @@ -3,6 +3,7 @@ package wtf.beatrice.hidekobot.commands.message; import net.dv8tion.jda.api.Permission; import net.dv8tion.jda.api.entities.MessageEmbed; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import wtf.beatrice.hidekobot.Cache; import wtf.beatrice.hidekobot.commands.base.BotInfo; @@ -32,6 +33,7 @@ public class BotInfoCommand implements MessageCommand return false; } + @NotNull @Override public CommandCategory getCategory() { return CommandCategory.TOOLS; diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/message/ClearCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/message/ClearCommand.java index 49f1614..b176eb2 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/message/ClearCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/message/ClearCommand.java @@ -4,6 +4,7 @@ import net.dv8tion.jda.api.Permission; import net.dv8tion.jda.api.entities.Message; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.interactions.components.buttons.Button; +import org.jetbrains.annotations.NotNull; import wtf.beatrice.hidekobot.Cache; import wtf.beatrice.hidekobot.commands.base.ClearChat; import wtf.beatrice.hidekobot.objects.commands.CommandCategory; @@ -28,6 +29,7 @@ public class ClearCommand implements MessageCommand public boolean passRawArgs() { return false; } + @NotNull @Override public CommandCategory getCategory() { return CommandCategory.MODERATION; diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/message/CoinFlipCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/message/CoinFlipCommand.java index 5fdb7f4..668a3d2 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/message/CoinFlipCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/message/CoinFlipCommand.java @@ -2,6 +2,7 @@ package wtf.beatrice.hidekobot.commands.message; import net.dv8tion.jda.api.Permission; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import wtf.beatrice.hidekobot.commands.base.CoinFlip; import wtf.beatrice.hidekobot.objects.commands.CommandCategory; @@ -30,6 +31,7 @@ public class CoinFlipCommand implements MessageCommand return false; } + @NotNull @Override public CommandCategory getCategory() { return CommandCategory.FUN; diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/message/DiceRollCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/message/DiceRollCommand.java index b66abbb..263c5a1 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/message/DiceRollCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/message/DiceRollCommand.java @@ -3,6 +3,7 @@ package wtf.beatrice.hidekobot.commands.message; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.Permission; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import wtf.beatrice.hidekobot.Cache; import wtf.beatrice.hidekobot.objects.Dice; @@ -29,6 +30,7 @@ public class DiceRollCommand implements MessageCommand return false; } + @NotNull @Override public CommandCategory getCategory() { return CommandCategory.FUN; diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/message/HelloCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/message/HelloCommand.java index f3ce756..d0e52bf 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/message/HelloCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/message/HelloCommand.java @@ -2,6 +2,7 @@ package wtf.beatrice.hidekobot.commands.message; import net.dv8tion.jda.api.Permission; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; +import org.jetbrains.annotations.NotNull; import wtf.beatrice.hidekobot.objects.commands.CommandCategory; import wtf.beatrice.hidekobot.objects.commands.MessageCommand; @@ -25,6 +26,7 @@ public class HelloCommand implements MessageCommand return false; } + @NotNull @Override public CommandCategory getCategory() { return CommandCategory.FUN; diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/message/HelpCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/message/HelpCommand.java index 4129016..799eb64 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/message/HelpCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/message/HelpCommand.java @@ -4,6 +4,7 @@ import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.Permission; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import org.apache.commons.text.WordUtils; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import wtf.beatrice.hidekobot.Cache; import wtf.beatrice.hidekobot.commands.base.Say; @@ -33,6 +34,7 @@ public class HelpCommand implements MessageCommand return false; } + @NotNull @Override public CommandCategory getCategory() { return CommandCategory.TOOLS; diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/message/InviteCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/message/InviteCommand.java index 94cdb1c..62bd641 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/message/InviteCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/message/InviteCommand.java @@ -5,6 +5,7 @@ import net.dv8tion.jda.api.entities.MessageEmbed; import net.dv8tion.jda.api.entities.emoji.Emoji; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.interactions.components.buttons.Button; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import wtf.beatrice.hidekobot.commands.base.Invite; import wtf.beatrice.hidekobot.objects.commands.CommandCategory; @@ -33,6 +34,7 @@ public class InviteCommand implements MessageCommand return false; } + @NotNull @Override public CommandCategory getCategory() { return CommandCategory.FUN; diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/message/LoveCalculatorCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/message/LoveCalculatorCommand.java index 8a5368d..96ef6fe 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/message/LoveCalculatorCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/message/LoveCalculatorCommand.java @@ -6,6 +6,7 @@ import net.dv8tion.jda.api.entities.IMentionable; import net.dv8tion.jda.api.entities.Mentions; import net.dv8tion.jda.api.entities.User; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import wtf.beatrice.hidekobot.Cache; import wtf.beatrice.hidekobot.HidekoBot; @@ -38,6 +39,7 @@ public class LoveCalculatorCommand implements MessageCommand return false; } + @NotNull @Override public CommandCategory getCategory() { return CommandCategory.FUN; diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/message/MagicBallCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/message/MagicBallCommand.java index 61bdb14..2497336 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/message/MagicBallCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/message/MagicBallCommand.java @@ -2,6 +2,7 @@ package wtf.beatrice.hidekobot.commands.message; import net.dv8tion.jda.api.Permission; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import wtf.beatrice.hidekobot.commands.base.MagicBall; import wtf.beatrice.hidekobot.objects.commands.CommandCategory; @@ -29,6 +30,7 @@ public class MagicBallCommand implements MessageCommand return false; } + @NotNull @Override public CommandCategory getCategory() { return CommandCategory.FUN; diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/message/SayCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/message/SayCommand.java index 68f1596..05d956d 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/message/SayCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/message/SayCommand.java @@ -2,6 +2,7 @@ package wtf.beatrice.hidekobot.commands.message; import net.dv8tion.jda.api.Permission; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import wtf.beatrice.hidekobot.commands.base.Say; import wtf.beatrice.hidekobot.objects.commands.CommandCategory; @@ -29,6 +30,7 @@ public class SayCommand implements MessageCommand return true; } + @NotNull @Override public CommandCategory getCategory() { return CommandCategory.TOOLS; diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/message/UrbanDictionaryCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/message/UrbanDictionaryCommand.java index 32df0ec..06877bb 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/message/UrbanDictionaryCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/message/UrbanDictionaryCommand.java @@ -4,6 +4,7 @@ import net.dv8tion.jda.api.Permission; import net.dv8tion.jda.api.entities.MessageEmbed; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.interactions.components.buttons.Button; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; @@ -35,6 +36,7 @@ public class UrbanDictionaryCommand implements MessageCommand return false; } + @NotNull @Override public CommandCategory getCategory() { return CommandCategory.FUN; diff --git a/src/main/java/wtf/beatrice/hidekobot/objects/commands/MessageCommand.java b/src/main/java/wtf/beatrice/hidekobot/objects/commands/MessageCommand.java index a1b5b3b..f861657 100644 --- a/src/main/java/wtf/beatrice/hidekobot/objects/commands/MessageCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/objects/commands/MessageCommand.java @@ -2,6 +2,7 @@ package wtf.beatrice.hidekobot.objects.commands; import net.dv8tion.jda.api.Permission; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.LinkedList; @@ -44,6 +45,7 @@ public interface MessageCommand * * @return the command category. */ + @NotNull CommandCategory getCategory(); /**