mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
add roll command
This commit is contained in:
@@ -180,6 +180,27 @@ public class Reputation : CommonHandler
|
|||||||
disableNotification: true);
|
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)
|
private async Task SendReputationModifyResponse(double reputation)
|
||||||
{
|
{
|
||||||
await Reply(
|
await Reply(
|
||||||
|
|||||||
Reference in New Issue
Block a user