using Telegram.Bot.Types.Enums; using Telegrator.Filters; namespace Telegrator.Annotations { /// /// Attribute for filtering messages that contain mentions. /// Allows handlers to respond only to messages that mention the bot or specific users. /// public class MentionedAttribute : MessageFilterAttribute { /// /// Initializes a new instance of the MentionedAttribute that matches any mention. /// public MentionedAttribute() : base(new MessageHasEntityFilter(MessageEntityType.Mention, 0, null), new MentionedFilter()) { } /// /// Initializes a new instance of the MentionedAttribute that matches mentions at a specific offset. /// /// The offset position where the mention should occur. public MentionedAttribute(int offset) : base(new MessageHasEntityFilter(MessageEntityType.Mention, offset, null), new MentionedFilter()) { } /// /// Initializes a new instance of the MentionedAttribute that matches a specific mention. /// /// The specific mention text to match. public MentionedAttribute(string mention) : base(new MessageHasEntityFilter(MessageEntityType.Mention), new MentionedFilter(mention)) { } /// /// Initializes a new instance of the MentionedAttribute that matches a specific mention at a specific offset. /// /// The specific mention text to match. /// The offset position where the mention should occur. public MentionedAttribute(string mention, int offset) : base(new MessageHasEntityFilter(MessageEntityType.Mention, offset, null), new MentionedFilter(mention)) { } } }