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:
@@ -55,7 +55,10 @@ public class Reputation : CommonHandler
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
[Message(InChat.Public, MessageFlag.HasText | MessageFlag.HasSticker)]
|
||||
[InChat(InChat.Public)]
|
||||
[HandleCondition(ConditionType.Any)]
|
||||
[Message(MessageFlag.HasText)]
|
||||
[Message(MessageFlag.HasSticker)]
|
||||
public async Task HandleReputation()
|
||||
{
|
||||
var text = Message?.Text;
|
||||
@@ -124,8 +127,9 @@ public class Reputation : CommonHandler
|
||||
$"{action} репутацию </code>{receiver.ToHtml()}<code>({Math.Round(receiverRepCount, 2)})</code>");
|
||||
}
|
||||
}
|
||||
|
||||
[ParametrizedCommand(InChat.Public, "setrep", CommandParseMode.Both)]
|
||||
|
||||
[InChat(InChat.Public)]
|
||||
[ParametrizedCommand("setrep", CommandParseMode.Both)]
|
||||
public async Task HandleSetRep(double reputation)
|
||||
{
|
||||
if (!CanModifyUserReputation(RepliedUser))
|
||||
@@ -138,7 +142,8 @@ public class Reputation : CommonHandler
|
||||
);
|
||||
}
|
||||
|
||||
[ParametrizedCommand(InChat.Public, "addrep", CommandParseMode.Both)]
|
||||
[InChat(InChat.Public)]
|
||||
[ParametrizedCommand("addrep", CommandParseMode.Both)]
|
||||
public async Task HandleAddRep(double reputation)
|
||||
{
|
||||
if (!CanModifyUserReputation(RepliedUser))
|
||||
@@ -150,8 +155,9 @@ public class Reputation : CommonHandler
|
||||
await _reputationService.IncrementReputationAsync(Chat, RepliedUser, reputation)
|
||||
);
|
||||
}
|
||||
|
||||
[Command(InChat.Public, "top", CommandParseMode.Both)]
|
||||
|
||||
[InChat(InChat.Public)]
|
||||
[Command("top", CommandParseMode.Both)]
|
||||
public async Task HandleTop()
|
||||
{
|
||||
var msg = new HtmlString();
|
||||
|
||||
Reference in New Issue
Block a user