Table of Contents

Class ModalInteractionAttribute

Namespace
Discord.Interactions
Assembly
Discord.Net.Interactions.dll

Create a Modal interaction handler. CustomId represents the CustomId of the Modal that will be handled.

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public sealed class ModalInteractionAttribute : Attribute
Inheritance
ModalInteractionAttribute
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

ModalInteractionAttribute(string, bool, RunMode)

Create a command for modal interaction handling.

public ModalInteractionAttribute(string customId, bool ignoreGroupNames = false, RunMode runMode = RunMode.Default)

Parameters

customId string

String to compare the modal CustomIDs with.

ignoreGroupNames bool

If trueGroupAttributes 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

CustomId

Gets the string to compare the Modal CustomIDs with.

public string CustomId { get; }

Property Value

string

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

bool

RunMode

Gets the run mode this command gets executed with.

public RunMode RunMode { get; }

Property Value

RunMode

TreatAsRegex

Gets or sets whether the CustomId should be treated as a raw Regex pattern.

public bool TreatAsRegex { get; set; }

Property Value

bool

Remarks

false defaults to the pattern used before 3.9.0.