Table of Contents

Class CommandContextTypeAttribute

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

Specifies context types this command can be executed in.

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class CommandContextTypeAttribute : Attribute
Inheritance
CommandContextTypeAttribute
Inherited Members

Constructors

CommandContextTypeAttribute(params InteractionContextType[])

Sets the ContextTypes property of an application command or module.

public CommandContextTypeAttribute(params InteractionContextType[] contextTypes)

Parameters

contextTypes InteractionContextType[]

Context types set for the command.

Properties

ContextTypes

Gets context types this command can be executed in.

public IReadOnlyCollection<InteractionContextType> ContextTypes { get; }

Property Value

IReadOnlyCollection<InteractionContextType>