From 1f584d3a52eade73b8c1645428cb953440907e67 Mon Sep 17 00:00:00 2001 From: Nikolay Kochulin Date: Tue, 9 Jul 2019 20:13:06 +0300 Subject: [PATCH] Make /status only get awards from current chat --- JetKarmaBot/Commands/StatusCommand.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/JetKarmaBot/Commands/StatusCommand.cs b/JetKarmaBot/Commands/StatusCommand.cs index db45e3b..995448d 100644 --- a/JetKarmaBot/Commands/StatusCommand.cs +++ b/JetKarmaBot/Commands/StatusCommand.cs @@ -35,7 +35,7 @@ namespace JetKarmaBot.Commands else { var awardsQuery = from award in db.Awards - where award.ToId == asker.Id + where award.ToId == asker.Id && award.ChatId == args.Message.Chat.Id group award by award.AwardTypeId into g select new { AwardTypeId = g.Key, Amount = g.Sum(x => x.Amount) }; var awardsByType = awardsQuery.ToList(); @@ -52,7 +52,7 @@ namespace JetKarmaBot.Commands var awardTypeId = awardTypeIdQuery.First(); var awardType = db.AwardTypes.Find(awardTypeId); - response = string.Format(currentLocale["jetkarmabot.status.listspecifictext"], db.Awards.Where(x => x.AwardTypeId == awardTypeId && x.ToId == asker.Id).Sum(x => x.Amount), awardType.Symbol); + response = string.Format(currentLocale["jetkarmabot.status.listspecifictext"], db.Awards.Where(x => x.AwardTypeId == awardTypeId && x.ToId == asker.Id && x.ChatId == args.Message.Chat.Id).Sum(x => x.Amount), awardType.Symbol); } Client.SendTextMessageAsync(