From f5edaf545d7e3e0eaa3cfa2dfa635e802b919383 Mon Sep 17 00:00:00 2001 From: Lan <50151341+Lannnnnnnnn@users.noreply.github.com> Date: Sat, 30 May 2020 15:57:10 +0300 Subject: [PATCH] general inventory --- Kehyeedra3/Commands/Economy.cs | 23 ++++++++++++++++++++++- Kehyeedra3/Commands/Interactive.cs | 2 ++ Kehyeedra3/Services/Models/Fishing.cs | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Kehyeedra3/Commands/Economy.cs b/Kehyeedra3/Commands/Economy.cs index 947547e..fd4afc7 100644 --- a/Kehyeedra3/Commands/Economy.cs +++ b/Kehyeedra3/Commands/Economy.cs @@ -2,6 +2,7 @@ using Discord.Addons.Interactive; using Discord.Commands; using Kehyeedra3.Services.Models; +using Microsoft.EntityFrameworkCore.Internal; using Microsoft.EntityFrameworkCore.Storage; using System; using System.Collections.Generic; @@ -596,7 +597,7 @@ namespace Kehyeedra3.Commands } } - [Command("inventory"), Alias("inv", "fishinv"), Summary("Shows the fish you have currently. Variables: fish tier")] + [Command("fishinventory"), Alias("finv", "fishinv"), Summary("Shows the fish you have currently. Variables: fish tier")] public async Task FishInventory(int? tier = null, IGuildUser user = null) { if (user == null) @@ -763,6 +764,26 @@ namespace Kehyeedra3.Commands await Context.Channel.SendMessageAsync("Go fish nigger").ConfigureAwait(false); } } + [Command("generalinventory"),Alias("ginv", "geninv"), Summary("Shows the items you have excluding fish.")] + public async Task GeneralInventory() + { + User user; + Dictionary inv = new Dictionary(); + List items = User.ListItems(); + User.Item item; + string message = ""; + using (var Database = new ApplicationDbContextFactory().CreateDbContext()) + { + user = Database.Users.FirstOrDefault(x => x.Id == Context.User.Id); + inv = user.GetGenInve(); + foreach (var entry in inv) + { + item = items.FirstOrDefault(x => x.Id == entry.Key); + message += $"**{item.Name}**: **{entry.Value[0]}**\n"; + } + await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n{message}"); + } + } [Command("tradebuy", RunMode = RunMode.Async), Summary("Unfinished command")] public async Task TradingBuy(int amount, string itemtype, int price, [Remainder] string item) { diff --git a/Kehyeedra3/Commands/Interactive.cs b/Kehyeedra3/Commands/Interactive.cs index dbe4a85..3f511a6 100644 --- a/Kehyeedra3/Commands/Interactive.cs +++ b/Kehyeedra3/Commands/Interactive.cs @@ -701,6 +701,8 @@ namespace Kehyeedra3.Commands } } + + [RequireRolePrecondition(AccessLevel.BotOwner)] [Command("setbf")] public async Task SetBattleFish(byte type, IUser usar = null) diff --git a/Kehyeedra3/Services/Models/Fishing.cs b/Kehyeedra3/Services/Models/Fishing.cs index 6c6791e..348f0ad 100644 --- a/Kehyeedra3/Services/Models/Fishing.cs +++ b/Kehyeedra3/Services/Models/Fishing.cs @@ -69,7 +69,7 @@ namespace Kehyeedra3.Services.Models { Id = FishSpecies.Doomfish, Name = "Doomfish", - Emote = "<:doomfish:651879988232060949>", + Emote = "", Rarity = FishRarity.Rare }, new Fish()