[reputation] Add debug logs.

This commit is contained in:
West14
2022-01-23 00:35:42 +02:00
parent 8f51f1ece0
commit a46c5c5ea6
@@ -100,6 +100,7 @@ namespace West.TelegramBot.ChatManagement.Handler
} }
var diff = Math.Round(senderRepCount == 0 ? 1 : Math.Sqrt(senderRepCount), 2); var diff = Math.Round(senderRepCount == 0 ? 1 : Math.Sqrt(senderRepCount), 2);
_logger.LogDebug("Calculated diff: {Diff}", diff);
string action; string action;
if (RepUpChars.Contains(text)) if (RepUpChars.Contains(text))
@@ -113,8 +114,10 @@ namespace West.TelegramBot.ChatManagement.Handler
action = "уменьшил"; action = "уменьшил";
} }
_logger.LogDebug("Saving receiver rep with value: {Value}", receiverRepCount);
receiverRepOption.SetValue(receiverRepCount); receiverRepOption.SetValue(receiverRepCount);
Db.Update(receiverRepOption); Db.Update(receiverRepOption);
_logger.LogDebug("Updated value: {Value}", receiverRepOption.GetValue<double>());
await Reply($"{From.ToHtml()}<code>({await GetUserReputation(From)}) " + await Reply($"{From.ToHtml()}<code>({await GetUserReputation(From)}) " +
$"{action} репутацию </code>{receiver.ToHtml()}<code>({Math.Round(receiverRepCount, 2)})</code>"); $"{action} репутацию </code>{receiver.ToHtml()}<code>({Math.Round(receiverRepCount, 2)})</code>");