mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
Update to Telegram Bot Framework 2.0
This commit is contained in:
@@ -27,7 +27,8 @@ public class Roll : CommonHandler
|
||||
private readonly UserService _userService;
|
||||
private readonly ConcurrentBag<DeleteRequest> _requests;
|
||||
|
||||
[Command(InChat.Public, "roll", CommandParseMode.Both)]
|
||||
[InChat(InChat.Public)]
|
||||
[Command("roll", CommandParseMode.Both)]
|
||||
public async Task HandleRoll()
|
||||
{
|
||||
var cdOption = await Db.UserValues.FindOrCreateOption(Chat.Id, From.Id, "rollNextUse");
|
||||
@@ -77,7 +78,8 @@ public class Roll : CommonHandler
|
||||
);
|
||||
}
|
||||
|
||||
[Command(InChat.Public, "reset_roll", CommandParseMode.Both)]
|
||||
[InChat(InChat.Public)]
|
||||
[Command("reset_roll", CommandParseMode.Both)]
|
||||
public async Task HandleResetRoll()
|
||||
{
|
||||
if (!_userService.IsUserSuper(From))
|
||||
@@ -99,7 +101,8 @@ public class Roll : CommonHandler
|
||||
await Reply($"Кулдаун /roll сброшен для чата \"{Chat.Title}\".");
|
||||
}
|
||||
|
||||
[ParametrizedCommand(InChat.Public, "rng_test", CommandParseMode.Both)]
|
||||
[InChat(InChat.Public)]
|
||||
[ParametrizedCommand("rng_test", CommandParseMode.Both)]
|
||||
public async Task HandleRngTest(int minValue, int maxValue)
|
||||
{
|
||||
if (!_userService.IsUserSuper(From))
|
||||
@@ -130,6 +133,7 @@ public class Roll : CommonHandler
|
||||
|
||||
await Bot.SendTextMessageAsync(Chat, $"Positive: {positive}.\nNegative: {negative}");
|
||||
}
|
||||
|
||||
protected override async Task<Message> Reply(string text)
|
||||
{
|
||||
// TODO: move feature with autocleaning to Core CommonHandler.
|
||||
|
||||
Reference in New Issue
Block a user