diff --git a/Kehyeedra3/Commands/Economy.cs b/Kehyeedra3/Commands/Economy.cs index 1701455..eadabc7 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.Storage; using System; using System.Collections.Generic; using System.Linq; @@ -968,5 +969,24 @@ namespace Kehyeedra3.Commands } } + [Command("stats"),Summary("View a user's stats")] + public async Task FishProfile(IUser otherUser = null) + { + using (var database = new ApplicationDbContextFactory().CreateDbContext()) + { + if (otherUser == null) + { + var user = database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id); + var muser = database.Users.FirstOrDefault(x => x.Id == Context.User.Id); + await Context.Channel.SendMessageAsync($"{Context.User.Mention}'s stats\nFishing level: **{user.Lvl}**\nFishing xp: **{user.TXp}**\nBalance: **{muser.Money/10000d}%**"); + } + else + { + var user = database.Fishing.FirstOrDefault(x => x.Id == otherUser.Id); + var muser = database.Users.FirstOrDefault(x => x.Id == otherUser.Id); + await Context.Channel.SendMessageAsync($"{otherUser.Mention}'s stats\nFishing level: **{user.Lvl}**\nFishing xp: **{user.TXp}**\nBalance: **{muser.Money/10000d}%**"); + } + } + } } }