nyxx-discord / nyxx_commands

A framework for easily creating slash commands and text commands for Discord using the nyxx library.
Apache License 2.0
13 stars 5 forks source link

Annotating a parameter with `@Name` does not reflect on Discord. #63

Closed Rapougnac closed 2 years ago

Rapougnac commented 2 years ago

Describe the bug Using the Name decorator does not reflect on Discord end and use the parameter name as argument.

To Reproduce

final testCommand = ChatCommand(
  'hi',
  'A test command',
  (IChatContext ctx, @Name('awawa') String foo) =>
     ctx.respond(MessageBuilder.content('A'),
  ),
);

// Command registration and all that stuff..

Currently, this is rendered as /hi foo

Expected behavior And should be rendered as /hi awawa

Screenshots image

Desktop (please complete the following information):

Additional context I think this is caused by this line when using dart:mirrors: https://github.com/nyxx-discord/nyxx_commands/blob/73b6015b075834339537aa2b60e7e0fc18050bb8/lib/src/mirror_utils/with_mirrors.dart#L39