diff --git a/JetKarmaBot/Commands/LeaderboardCommand.cs b/JetKarmaBot/Commands/LeaderboardCommand.cs index fc82e87..439c1cc 100644 --- a/JetKarmaBot/Commands/LeaderboardCommand.cs +++ b/JetKarmaBot/Commands/LeaderboardCommand.cs @@ -18,6 +18,7 @@ namespace JetKarmaBot.Commands var currentLocale = ctx.GetFeature(); var asker = ctx.EventArgs.Message.From; var awardTypeName = ctx.Command.Parameters.FirstOrDefault(); + bool isPrivate = ctx.EventArgs.Message.Chat.Type == Telegram.Bot.Types.Enums.ChatType.Private; if (string.IsNullOrWhiteSpace(awardTypeName)) awardTypeName = "star"; @@ -30,7 +31,7 @@ namespace JetKarmaBot.Commands await ctx.SendMessage(string.Format(currentLocale["jetkarmabot.leaderboard.specifictext"], awardType.Symbol) + "\n" + string.Join('\n', await Task.WhenAll((await db.Awards - .Where(x => x.ChatId == ctx.EventArgs.Message.Chat.Id && x.AwardTypeId == awardTypeId) + .Where(x => (x.ChatId == ctx.EventArgs.Message.Chat.Id || isPrivate) && x.AwardTypeId == awardTypeId) .GroupBy(x => x.ToId) .Select(x => new { UserId = x.Key, Amount = x.Sum(y => y.Amount) }) .OrderByDescending(x => x.Amount) diff --git a/JetKarmaBot/Commands/StatusCommand.cs b/JetKarmaBot/Commands/StatusCommand.cs index 3ef93c4..2d3276f 100644 --- a/JetKarmaBot/Commands/StatusCommand.cs +++ b/JetKarmaBot/Commands/StatusCommand.cs @@ -57,7 +57,7 @@ namespace JetKarmaBot.Commands await db.Awards.Where( x => x.AwardTypeId == awardTypeId && x.ToId == asker.Id - && x.ChatId == ctx.EventArgs.Message.Chat.Id) + && (x.ChatId == ctx.EventArgs.Message.Chat.Id || isPrivate)) .SumAsync(x => x.Amount), awardType.Symbol); }