using System; using System.Runtime.CompilerServices; namespace Discord.Interactions { /// /// Create a Message Component interaction handler, CustomId represents /// the CustomId of the Message Component that will be handled. /// /// /// s will add prefixes to this command if is set to /// CustomID supports a Wild Card pattern where you can use the to match a set of CustomIDs. /// [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] public class ComponentInteractionAttribute : Attribute { /// /// Gets the string to compare the Message Component CustomIDs with. /// public string CustomId { get; } /// /// Gets if s will be ignored while creating this command and this method will be treated as a top level command. /// public bool IgnoreGroupNames { get; } /// /// Gets the run mode this command gets executed with. /// public RunMode RunMode { get; } /// /// Gets or sets whether the should be treated as a raw Regex pattern. /// /// /// defaults to the pattern used before 3.9.0. /// public bool TreatAsRegex { get; set; } = false; /// /// Create a command for component interaction handling. /// /// String to compare the Message Component CustomIDs with. /// If s will be ignored while creating this command and this method will be treated as a top level command. /// Set the run mode of the command. public ComponentInteractionAttribute(string customId, bool ignoreGroupNames = false, RunMode runMode = RunMode.Default) { CustomId = customId; IgnoreGroupNames = ignoreGroupNames; RunMode = runMode; } } }