diff options
Diffstat (limited to 'src/main/java/net/uomc/mineshaft/DailyCommand.java')
| -rw-r--r-- | src/main/java/net/uomc/mineshaft/DailyCommand.java | 40 |
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; + } +} |
