Class ComponentInteractionAttribute
Create a Message Component interaction handler, CustomId represents the CustomId of the Message Component that will be handled.
Namespace: Discord.Interactions
Assembly: Discord.Net.Interactions.dll
Syntax
public class ComponentInteractionAttribute : Attribute
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
| Improve this Doc View SourceComponentInteractionAttribute(String, Boolean, RunMode)
Create a command for component interaction handling.
Declaration
public ComponentInteractionAttribute(string customId, bool ignoreGroupNames = false, RunMode runMode = RunMode.Default)
Parameters
Type | Name | Description |
---|---|---|
String | customId | String to compare the Message Component CustomIDs with. |
Boolean | ignoreGroupNames | If true GroupAttributes will be ignored while creating this command and this method will be treated as a top level command. |
RunMode | runMode | Set the run mode of the command. |
Properties
| Improve this Doc View SourceCustomId
Gets the string to compare the Message Component CustomIDs with.
Declaration
public string CustomId { get; }
Property Value
Type | Description |
---|---|
String |
IgnoreGroupNames
Gets true if GroupAttributes will be ignored while creating this command and this method will be treated as a top level command.
Declaration
public bool IgnoreGroupNames { get; }
Property Value
Type | Description |
---|---|
Boolean |
RunMode
Gets the run mode this command gets executed with.
Declaration
public RunMode RunMode { get; }
Property Value
Type | Description |
---|---|
RunMode |
TreatAsRegex
Gets or sets whether the CustomId should be treated as a raw Regex pattern.
Declaration
public bool TreatAsRegex { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
false defaults to the pattern used before 3.9.0.