[entertainment] add roll command by @frolish

Co-authored-by: Frolish <lonkura.zip@gmail.com>
This commit is contained in:
Andriy
2022-12-14 11:40:27 +02:00
parent 9e198da41e
commit 4f89be554a
2 changed files with 42 additions and 22 deletions
+1 -22
View File
@@ -179,28 +179,7 @@ public class Reputation : CommonHandler
await Bot.SendTextMessageAsync(Chat!, msg.ToString(), ParseMode.Html,
disableNotification: true);
}
[Command(InChat.Public, "roll", CommandParseMode.Both)]
public async Task HandleRoll()
{
var cdOption = await Db.UserValues.FindOrCreateOption(Chat.Id, From.Id, "rollNextUse");
var cd = cdOption.GetValue<DateTime>();
if(cd > DateTime.Now)
{
await Reply("Ты уже крутил!");
return;
}
int new_rep = new Random().Next(-50, 51);
await Reply($"Вы выиграли {new_rep} кармы на сиськи!");
//await _reputationService.IncrementReputationAsync(Chat, From, new_rep);
cdOption.SetValue(DateTime.Now.AddDays(1));
Db.AddOrUpdate(cdOption);
}
private async Task SendReputationModifyResponse(double reputation)
{
await Reply(