Assorted improvements.

- Move BotExtension to Core.
- Update BotFramework
- Fix Fun commands.
- Remove ChatManagement dependency from Entertainment.
This commit is contained in:
West14
2022-01-03 14:58:53 +02:00
parent fad01168aa
commit b99614868b
8 changed files with 57 additions and 31 deletions
+17 -8
View File
@@ -13,25 +13,34 @@ namespace West.Entertainment.Handler.Fun
{
public Bayan(CoreContext db) : base(db) { }
protected override Regex AnimationMatch => new("^баян$", RegexOptions.IgnoreCase);
protected override Regex AnimationMatch
=> new("^баян$", RegexOptions.IgnoreCase);
protected override string GetAnimationName() => "bayan";
protected override string GetAnimationName()
=> "bayan";
[Command(InChat.Public, "setbayan", CommandParseMode.Both)]
public async Task HandleSetBayan() => await HandleSetAnimation();
public async Task HandleSetBayan()
=> await HandleSetAnimation();
protected override async Task<bool> HandleAnimation(int? replyToMessageId = null)
[Message(InChat.Public, MessageFlag.HasText)]
public override async Task<bool> HandleAnimation()
{
if (await base.HandleAnimation(replyToMessageId))
if (await base.HandleAnimation())
{
await Bot.DeleteMessageAsync(Chat.Id, Message!.MessageId);
}
return true;
}
protected override bool CanHandle() => Message?.ReplyToMessage != null;
protected override int? GetMessageIdToReply()
{
return Message!.ReplyToMessage!.MessageId;
}
protected override bool CanHandle()
=> Message?.ReplyToMessage != null;
}
}