mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
[reputation] fix top fails when user left chat
This commit is contained in:
@@ -159,7 +159,17 @@ public class Reputation : CommonHandler
|
|||||||
var i = 1;
|
var i = 1;
|
||||||
foreach (var rep in await _reputationService.GetChatRatingAsync(Chat))
|
foreach (var rep in await _reputationService.GetChatRatingAsync(Chat))
|
||||||
{
|
{
|
||||||
var user = await _userService.GetUser(rep.UserId, rep.ChatId);
|
// TODO: there are should be more correct fix, but I want to fix this now, West, 18:04, 07.05.2022
|
||||||
|
User user;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
user = await _userService.GetUser(rep.UserId, rep.ChatId);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
msg.Text($"{i}. ")
|
msg.Text($"{i}. ")
|
||||||
.Text($"{user.FirstName} {user.LastName}".Trim().HtmlEncode())
|
.Text($"{user.FirstName} {user.LastName}".Trim().HtmlEncode())
|
||||||
.Text($" ({rep.Value})").Br();
|
.Text($" ({rep.Value})").Br();
|
||||||
|
|||||||
Reference in New Issue
Block a user