< Summary

Information
Class: TeleFlow.Annotations.AutoAnswerCallbackAttribute
Assembly: TeleFlow.Annotations
File(s): /_/src/TeleFlow.Annotations/Callbacks/AutoAnswerCallbackAttribute.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 39
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%
.ctor(...)100%11100%

File(s)

/_/src/TeleFlow.Annotations/Callbacks/AutoAnswerCallbackAttribute.cs

#LineLine coverage
 1namespace TeleFlow.Annotations;
 2/// <summary>
 3/// Configures automatic answering of matched Telegram callback queries.
 4/// </summary>
 5[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
 6public sealed class AutoAnswerCallbackAttribute : TeleFlowAttribute
 7{
 8    /// <summary>
 9    /// Enables automatic callback answering with no text.
 10    /// </summary>
 411    public AutoAnswerCallbackAttribute()
 12    {
 413    }
 14
 15    /// <summary>
 16    /// Enables automatic callback answering with the specified answer text.
 17    /// </summary>
 18    /// <param name="text">Text to send in the callback query answer.</param>
 1619    public AutoAnswerCallbackAttribute(string text)
 20    {
 1621        ArgumentException.ThrowIfNullOrWhiteSpace(text);
 1622        Text = text.Trim();
 1623    }
 24
 25    /// <summary>
 26    /// Text sent in the automatic callback query answer.
 27    /// </summary>
 28    public string? Text { get; }
 29
 30    /// <summary>
 31    /// Shows the callback answer as an alert instead of a notification.
 32    /// </summary>
 33    public bool ShowAlert { get; set; }
 34
 35    /// <summary>
 36    /// Enables or disables automatic callback answering for the annotated scope.
 37    /// </summary>
 38    public bool Enabled { get; set; } = true;
 39}

Methods/Properties

.ctor()
.ctor(System.String)