Class ComponentInteractionAttribute
- Namespace
- Discord.Interactions
- Assembly
- Discord.Net.Interactions.dll
Create a Message Component interaction handler, CustomId represents the CustomId of the Message Component that will be handled.
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class ComponentInteractionAttribute : Attribute
- Inheritance
-
ComponentInteractionAttribute
- Inherited Members
Remarks
GroupAttributes will add prefixes to this command if IgnoreGroupNames is set to false CustomID supports a Wild Card pattern where you can use the WildCardExpression to match a set of CustomIDs.
Constructors
ComponentInteractionAttribute(string, bool, RunMode)
Create a command for component interaction handling.
public ComponentInteractionAttribute(string customId, bool ignoreGroupNames = false, RunMode runMode = RunMode.Default)
Parameters
customId
stringString to compare the Message Component CustomIDs with.
ignoreGroupNames
boolIf trueGroupAttributes will be ignored while creating this command and this method will be treated as a top level command.
runMode
RunModeSet the run mode of the command.
Properties
CustomId
Gets the string to compare the Message Component CustomIDs with.
public string CustomId { get; }
Property Value
IgnoreGroupNames
Gets true if GroupAttributes will be ignored while creating this command and this method will be treated as a top level command.
public bool IgnoreGroupNames { get; }
Property Value
RunMode
Gets the run mode this command gets executed with.
public RunMode RunMode { get; }
Property Value
TreatAsRegex
Gets or sets whether the CustomId should be treated as a raw Regex pattern.
public bool TreatAsRegex { get; set; }
Property Value
Remarks
false defaults to the pattern used before 3.9.0.