diff --git a/build.gradle b/build.gradle index b826ef8..68281ac 100644 --- a/build.gradle +++ b/build.gradle @@ -4,6 +4,7 @@ plugins { id'com.github.johnrengelman.shadow' version '7.0.0' } +mainClassName = 'github.io.koala3353.Main' group 'github.io.koala3353' version '1.0-SNAPSHOT' diff --git a/src/main/java/github/io/koala3353/bot/Bot.java b/src/main/java/github/io/koala3353/bot/Bot.java index a4a44b9..0569c06 100644 --- a/src/main/java/github/io/koala3353/bot/Bot.java +++ b/src/main/java/github/io/koala3353/bot/Bot.java @@ -5,8 +5,7 @@ import com.jagrosh.jdautilities.command.CommandClientBuilder; import com.jagrosh.jdautilities.command.SlashCommand; import com.jagrosh.jdautilities.commons.waiter.EventWaiter; import github.io.koala3353.Config; -import github.io.koala3353.bot.commands.AboutCommand; -import github.io.koala3353.bot.commands.TradeCommand; +import github.io.koala3353.bot.commands.*; import net.dv8tion.jda.api.JDA; import net.dv8tion.jda.api.JDABuilder; import net.dv8tion.jda.api.OnlineStatus; @@ -49,7 +48,8 @@ public class Bot { } private static void addCommands(CommandClientBuilder clientBuilder) { // Initialize the commands of the bot - clientBuilder.addSlashCommands(new TradeCommand(), new AboutCommand()); + clientBuilder.addSlashCommands(new TradeCommand(), new AboutCommand(), new HelpCommand(), new StartAdventureCommand(), + new ProfileCommand(), new ShopCommand(), new ViewInventoryCommand(), new BalanceCommand(), new EquipCommand()); LOGGER.info("Added the slash commands"); clientBuilder.addContextMenus(); LOGGER.info("Added the context menus"); diff --git a/src/main/java/github/io/koala3353/bot/commands/AboutCommand.java b/src/main/java/github/io/koala3353/bot/commands/AboutCommand.java index 5bf8467..6613e46 100644 --- a/src/main/java/github/io/koala3353/bot/commands/AboutCommand.java +++ b/src/main/java/github/io/koala3353/bot/commands/AboutCommand.java @@ -15,10 +15,29 @@ public class AboutCommand extends SlashCommand { @Override protected void execute(SlashCommandEvent event) { EmbedBuilder aboutEmbed = new EmbedBuilder(); - aboutEmbed.setTitle("About the bot"); - aboutEmbed.setDescription("This bot is a simple bot created by Koala3353"); - aboutEmbed.setColor(Color.decode("#2A2E75")); - - event.reply("This bot is a simple bot created by Koala3353").queue(); + aboutEmbed.setDescription(""" + The RPG Discord bot made for Hack club's game jam with the theme of **loopholes** + + Greetings fellow adventurer! You are stuck in a mysterious time loop and the only way to get out is to find the mythical item called **The Hole**. + + Embark on a journey to go into a mysterious cave and find the treasure inside! But be careful, there are many dangers that await you! Will you go any deeper and get more rewards or take the cowards way out? + + Check out the commands here with to get started! + + ### The Adventure's Code: + - Look for an adventure! Type to start your journey! + - Open your imagination on how to defeat the monsters and get the treasure! + - Once you defeat the monster, you will get a reward! You will have an option to exit the cave or go deeper! + - Play with your friends and see who can get the most rewards and escape the time loop! + - Have fun and trade your items. + - Once you find **The Hole**, you will be able to escape the time loop! + - Look for the loopholes in the game and exploit them to your advantage! + - Enjoy the game and have fun! If you figure out a loophole, don't share it to others! + + This bot is made by [Koala3353](https://github.com/Koala3353) (Koala). The source code is available on [GitHub](https://github.com/Koala3353/rpg-discord-bot). It was made in Java using JDA and JDA-Utilities from August 18, 2024 to August 21, 2024."""); + aboutEmbed.setColor(Color.decode("#4A2C6E")); + aboutEmbed.setAuthor("About the bot", null, event.getJDA().getSelfUser().getAvatarUrl()); + aboutEmbed.setFooter("How it starts is better than how it ends"); + event.replyEmbeds(aboutEmbed.build()).setEphemeral(true).queue(); } } diff --git a/src/main/java/github/io/koala3353/bot/commands/BalanceCommand.java b/src/main/java/github/io/koala3353/bot/commands/BalanceCommand.java new file mode 100644 index 0000000..e29f9c0 --- /dev/null +++ b/src/main/java/github/io/koala3353/bot/commands/BalanceCommand.java @@ -0,0 +1,16 @@ +package github.io.koala3353.bot.commands; + +import com.jagrosh.jdautilities.command.SlashCommand; +import com.jagrosh.jdautilities.command.SlashCommandEvent; + +public class BalanceCommand extends SlashCommand { + public BalanceCommand() { + this.name = "balance"; + this.help = "View your balance"; + } + + @Override + protected void execute(SlashCommandEvent event) { + event.reply("Balance command is not implemented yet!").queue(); + } +} diff --git a/src/main/java/github/io/koala3353/bot/commands/EquipCommand.java b/src/main/java/github/io/koala3353/bot/commands/EquipCommand.java new file mode 100644 index 0000000..dacded3 --- /dev/null +++ b/src/main/java/github/io/koala3353/bot/commands/EquipCommand.java @@ -0,0 +1,17 @@ +package github.io.koala3353.bot.commands; + +import com.jagrosh.jdautilities.command.SlashCommand; +import com.jagrosh.jdautilities.command.SlashCommandEvent; + +public class EquipCommand extends SlashCommand { + public EquipCommand() { + this.name = "equip"; + this.help = "Equip an item from your inventory"; + } + + @Override + protected void execute(SlashCommandEvent event) { + // Equip the item + event.reply("You have equipped the item").queue(); + } +} diff --git a/src/main/java/github/io/koala3353/bot/commands/HelpCommand.java b/src/main/java/github/io/koala3353/bot/commands/HelpCommand.java index 8b4ad24..1d793a1 100644 --- a/src/main/java/github/io/koala3353/bot/commands/HelpCommand.java +++ b/src/main/java/github/io/koala3353/bot/commands/HelpCommand.java @@ -1,4 +1,35 @@ package github.io.koala3353.bot.commands; -public class HelpCommand { +import com.jagrosh.jdautilities.command.SlashCommand; +import com.jagrosh.jdautilities.command.SlashCommandEvent; +import net.dv8tion.jda.api.EmbedBuilder; + +import java.awt.*; + +public class HelpCommand extends SlashCommand { + public HelpCommand() { + this.name = "help"; + this.help = "Get help on how to play the game"; + } + + @Override + protected void execute(SlashCommandEvent event) { + EmbedBuilder embed = new EmbedBuilder(); + embed.setAuthor("Help", null, event.getJDA().getSelfUser().getAvatarUrl()); + embed.setDescription(""" + ## Commands: + 1. - Start your adventure + 2. - Commence a trade with a NPC + 3. - Get information about the bot and the game + 4. - Get help on how to play the game + 5. - View your profile + 6. - Visit the shop + 7. - View your inventory + 8. - View your balance + 9. - Equip an item from your inventory + """); + embed.setColor(Color.decode("#4A2C6E")); + embed.setFooter("How ABOUT looking at the START but never what happens AFTER?"); + event.replyEmbeds(embed.build()).setEphemeral(true).queue(); + } } diff --git a/src/main/java/github/io/koala3353/bot/commands/ProfileCommand.java b/src/main/java/github/io/koala3353/bot/commands/ProfileCommand.java index eaf2e27..dae8973 100644 --- a/src/main/java/github/io/koala3353/bot/commands/ProfileCommand.java +++ b/src/main/java/github/io/koala3353/bot/commands/ProfileCommand.java @@ -1,4 +1,16 @@ package github.io.koala3353.bot.commands; -public class ProfileCommand { +import com.jagrosh.jdautilities.command.SlashCommand; +import com.jagrosh.jdautilities.command.SlashCommandEvent; + +public class ProfileCommand extends SlashCommand { + public ProfileCommand() { + this.name = "profile"; + this.help = "View your profile"; + } + + @Override + protected void execute(SlashCommandEvent event) { + event.reply("Profile command is not implemented yet!").queue(); + } } diff --git a/src/main/java/github/io/koala3353/bot/commands/ShopCommand.java b/src/main/java/github/io/koala3353/bot/commands/ShopCommand.java index 1c43a58..09d8c48 100644 --- a/src/main/java/github/io/koala3353/bot/commands/ShopCommand.java +++ b/src/main/java/github/io/koala3353/bot/commands/ShopCommand.java @@ -1,4 +1,16 @@ package github.io.koala3353.bot.commands; -public class ShopCommand { +import com.jagrosh.jdautilities.command.SlashCommand; +import com.jagrosh.jdautilities.command.SlashCommandEvent; + +public class ShopCommand extends SlashCommand { + public ShopCommand() { + this.name = "shop"; + this.help = "Buy items from the shop"; + } + + @Override + protected void execute(SlashCommandEvent event) { + event.reply("Shop command is not implemented yet!").queue(); + } } diff --git a/src/main/java/github/io/koala3353/bot/commands/StartAdventureCommand.java b/src/main/java/github/io/koala3353/bot/commands/StartAdventureCommand.java index 8cd5578..4aeed2a 100644 --- a/src/main/java/github/io/koala3353/bot/commands/StartAdventureCommand.java +++ b/src/main/java/github/io/koala3353/bot/commands/StartAdventureCommand.java @@ -1,4 +1,16 @@ package github.io.koala3353.bot.commands; -public class StartAdventureCommand { +import com.jagrosh.jdautilities.command.SlashCommand; +import com.jagrosh.jdautilities.command.SlashCommandEvent; + +public class StartAdventureCommand extends SlashCommand { + public StartAdventureCommand() { + this.name = "start"; + this.help = "Start your adventure"; + } + + @Override + protected void execute(SlashCommandEvent event) { + event.reply("Start adventure command is not implemented yet!").queue(); + } } diff --git a/src/main/java/github/io/koala3353/bot/commands/ViewInventoryCommand.java b/src/main/java/github/io/koala3353/bot/commands/ViewInventoryCommand.java index 99cf102..dccc086 100644 --- a/src/main/java/github/io/koala3353/bot/commands/ViewInventoryCommand.java +++ b/src/main/java/github/io/koala3353/bot/commands/ViewInventoryCommand.java @@ -1,4 +1,16 @@ package github.io.koala3353.bot.commands; -public class ViewInventoryCommand { +import com.jagrosh.jdautilities.command.SlashCommand; +import com.jagrosh.jdautilities.command.SlashCommandEvent; + +public class ViewInventoryCommand extends SlashCommand { + public ViewInventoryCommand() { + this.name = "inventory"; + this.help = "View your inventory"; + } + + @Override + protected void execute(SlashCommandEvent event) { + event.reply("Inventory command is not implemented yet!").queue(); + } }