Can you inject custom values into the method signature through a custom decorator if its an application command? #9727
Unanswered
Zitronenjoghurt
asked this question in
Q&A
Replies: 1 comment 1 reply
-
@Zitronenjoghurt the simple answer is no. Application commands cannot be called by other application commands, nor would I be in support of an implementation as you described. In your case, it is advisable to separate the logic from your refund command into an function, and reuse it in your greet command. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In my custom decorator I am trying to pass a refund function to the greet method so that in case of an error the costs of the command can easily be refunded:
Though as I have noticed all parameters in that method except interaction are automatically turned into command parameters. Is there some way around that? I saw that some decorators have an extras field, it would be really helpful to have something like that for the method signature too.
Beta Was this translation helpful? Give feedback.
All reactions