Class ContextMenuAttribute
Marks this method as a context menu.
Inheritance
System.Object
System.Attribute
ContextMenuAttribute
Namespace: DisCatSharp.ApplicationCommands
Assembly: DisCatSharp.ApplicationCommands.dll
Syntax
[AttributeUsage(AttributeTargets.Method)]
public sealed class ContextMenuAttribute : Attribute
Constructors
| Improve this Doc View SourceContextMenuAttribute(ApplicationCommandType, String, Boolean)
Marks this method as a context menu.
Declaration
public ContextMenuAttribute(ApplicationCommandType type, string name, bool isNsfw = false)
Parameters
Type | Name | Description |
---|---|---|
ApplicationCommandType | type | The type of the context menu. |
System.String | name | The name of the context menu. |
System.Boolean | isNsfw | Whether this context menu command is marked as NSFW. |
ContextMenuAttribute(ApplicationCommandType, String, Int64, Boolean)
Marks this method as a context menu.
Declaration
public ContextMenuAttribute(ApplicationCommandType type, string name, long defaultMemberPermissions, bool isNsfw = false)
Parameters
Type | Name | Description |
---|---|---|
ApplicationCommandType | type | The type of the context menu. |
System.String | name | The name of the context menu. |
System.Int64 | defaultMemberPermissions | The default member permissions. |
System.Boolean | isNsfw | Whether this context menu command is marked as NSFW. |
Properties
| Improve this Doc View SourceDefaultMemberPermissions
Gets the commands needed permissions.
Declaration
public Permissions? DefaultMemberPermissions { get; }
Property Value
Type | Description |
---|---|
System.Nullable<Permissions> |
IsNsfw
Gets whether this command is marked as NSFW
Declaration
public bool IsNsfw { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Name
Gets the name of this context menu.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Type
Gets the type of this context menu.
Declaration
public ApplicationCommandType Type { get; }
Property Value
Type | Description |
---|---|
ApplicationCommandType |