Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0.0] @CommandDescription ignored #58

Open
Stijn-van-Nieulande opened this issue Mar 29, 2024 · 3 comments
Open

[2.0.0] @CommandDescription ignored #58

Stijn-van-Nieulande opened this issue Mar 29, 2024 · 3 comments

Comments

@Stijn-van-Nieulande
Copy link

Stijn-van-Nieulande commented Mar 29, 2024

Hello,
I got a issue with the @CommandDescription annotations in the new cloud 2 environment with JDA5.
When using the command description annotation the value of it is "ignored" and the last parameter of the command is used as the description.
Discord_qie3rYoCSt
It seems that the description is used of the last non flag argument which doesn't have a description attached to it.
idea64_zOMOVvOpmZ
idea64_o66uh1lfoJ
idea64_e5YnK1wfeI

@Citymonstret
Copy link
Member

This is semi-intentional. A cloud command is a unique chain of arguments whereas Discord considers the root literal to be the command, and everything else to be an argument. Because a root literal may be used for multiple cloud commands, it would be far less accurate to use the cloud command description as the Discord command description. The component descriptions are re-used across commands so they are a better fit.

The issue here is that the wrong component description is used. It should use the root description, not the tail description.

@masmc05
Copy link

masmc05 commented Apr 6, 2024

This is semi-intentional. A cloud command is a unique chain of arguments whereas Discord considers the root literal to be the command, and everything else to be an argument. Because a root literal may be used for multiple cloud commands, it would be far less accurate to use the cloud command description as the Discord command description. The component descriptions are re-used across commands so they are a better fit.

The issue here is that the wrong component description is used. It should use the root description, not the tail description.

That's not really true, you need to specify the description per sub command in constructor (https://javadoc.io/doc/net.dv8tion/JDA/latest/net/dv8tion/jda/api/interactions/commands/build/SubcommandData.html#%3Cinit%3E(java.lang.String,java.lang.String), when using subcommands, the description of the root command is only displayed in guid settings in "interactions" section, and is not really displayed to the user

@Citymonstret
Copy link
Member

This is semi-intentional. A cloud command is a unique chain of arguments whereas Discord considers the root literal to be the command, and everything else to be an argument. Because a root literal may be used for multiple cloud commands, it would be far less accurate to use the cloud command description as the Discord command description. The component descriptions are re-used across commands so they are a better fit.
The issue here is that the wrong component description is used. It should use the root description, not the tail description.

That's not really true, you need to specify the description per sub command in constructor (https://javadoc.io/doc/net.dv8tion/JDA/latest/net/dv8tion/jda/api/interactions/commands/build/SubcommandData.html#%3Cinit%3E(java.lang.String,java.lang.String), when using subcommands, the description of the root command is only displayed in guid settings in "interactions" section, and is not really displayed to the user

Interesting. I wasn't aware of this, but it'd then be fine to prioritize the command description if it exists. I'd appreciate a PR to deal with this if anyone wants to see it dealt with.

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

No branches or pull requests

3 participants