Skip to content

Add SlashCommandIgnoreAttribute for hiding enum values from slash commands#388

Open
Zont1k wants to merge 2 commits into
NetCordDev:mainfrom
Zont1k:feature/enum-ignore-attribute
Open

Add SlashCommandIgnoreAttribute for hiding enum values from slash commands#388
Zont1k wants to merge 2 commits into
NetCordDev:mainfrom
Zont1k:feature/enum-ignore-attribute

Conversation

@Zont1k

@Zont1k Zont1k commented Jul 16, 2026

Copy link
Copy Markdown

Description

Adds a new attribute that can be applied to enum fields to exclude them from being shown as options in slash commands.

Closes #330

Changes

  • Added in
  • Modified to filter out fields with the attribute
  • Added unit test

Usage

public enum MyEnum
{
    Value1,
    [SlashCommandIgnore]
    None = 0,  // Will not be shown in slash commands
    Value2,
}

Note

The project requires .NET SDK 10.0.301 for source generators which is not available in my local environment, so I was unable to run the full test suite. However, the logic is straightforward and follows the existing pattern used by .

@github-actions

Copy link
Copy Markdown

The documentation preview is available at https://preview.netcord.dev/388.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a way to ignore specific enum values from being shown as options on discord.

1 participant