Skip to content

Introduce CommandArgument and CommandArguments for slash commands#28

Merged
sieadev merged 1 commit intomasterfrom
feature/command-arguments
Oct 31, 2025
Merged

Introduce CommandArgument and CommandArguments for slash commands#28
sieadev merged 1 commit intomasterfrom
feature/command-arguments

Conversation

@sieadev
Copy link
Copy Markdown
Member

@sieadev sieadev commented Oct 31, 2025

This PR adds two new classes to improve slash command argument handling:

  • CommandArgument – represents a single argument with type-safe access methods (e.g., .getAsString()).
  • CommandArguments – a container for all arguments passed to a command, replacing the old Map<String, Object> approach.

Changes:

  • Slash command methods now support only two valid signatures:
    • (SlashCommandInteractionEvent event)
    • (SlashCommandInteractionEvent event, CommandArguments args)
  • Methods using the old (event, Map) signature are marked as deprecated at compile-time.
  • Unsupported method signatures now produce compile-time errors.
  • Existing modules using the old (event, Map) signature continue to work but receive deprecation warnings.

@sieadev sieadev merged commit 5b05f52 into master Oct 31, 2025
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.

1 participant