summaryrefslogtreecommitdiff
path: root/src/main/java/net/uomc/mineshaft/DailyCommand.java
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2025-10-11 04:55:51 +0100
committerdavidovski <david@davidovski.xyz>2025-10-11 04:55:51 +0100
commit10b327e9f6441a8863227ce3e075a5a587654065 (patch)
tree5e94ecc91290febacf5181d3596563a7a24bd010 /src/main/java/net/uomc/mineshaft/DailyCommand.java
v0.3.1
Diffstat (limited to 'src/main/java/net/uomc/mineshaft/DailyCommand.java')
-rw-r--r--src/main/java/net/uomc/mineshaft/DailyCommand.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/main/java/net/uomc/mineshaft/DailyCommand.java b/src/main/java/net/uomc/mineshaft/DailyCommand.java
new file mode 100644
index 0000000..fc814d1
--- /dev/null
+++ b/src/main/java/net/uomc/mineshaft/DailyCommand.java
@@ -0,0 +1,40 @@
+package net.uomc.mineshaft;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import com.mouldycheerio.dbot.commands.CommandDetails;
+import com.mouldycheerio.dbot.commands.cooldowns.CooldownCommand;
+
+import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
+
+public class DailyCommand extends CooldownCommand {
+
+ Mineshaft bot;
+
+ public DailyCommand(Mineshaft bot) {
+ super(bot);
+ setCommandDetails(CommandDetails.from("daily", "get free ores", "furnace"));
+ this.bot = bot;
+
+ setCooldown(24l* 60l * 60l * 1000l);
+ }
+
+ @Override
+ public boolean trigger(MessageReceivedEvent e) {
+
+
+ Map<MineshaftItem, Long> award = new LinkedHashMap<>();
+ for (int i = 0; i < 10; ++i) {
+ award = bot.sumItems(award,
+ bot.getMineCommand().getAwards(e.getMember(),
+ bot.getMineCommand().getOre(
+ bot.getPickaxes().getPickaxeLevel(e.getMember()))));
+ }
+ ;
+
+ String awardsList = bot.createItemList(award, "+%s", ", ");
+ bot.sendSuccessMessage(e, "You received your daily ores:\n**" + awardsList +"**");
+ return true;
+ }
+}