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

Only prefix commands show up in help menu #13

Closed
vicky5124 opened this issue Oct 10, 2021 · 9 comments
Closed

Only prefix commands show up in help menu #13

vicky5124 opened this issue Oct 10, 2021 · 9 comments

Comments

@vicky5124
Copy link
Contributor

If a context menu command is registered, it will not show up in help, even if it's also allowed to run as a slash or prefix command, though, that should probably not matter and show up anyway.

/// Test
#[poise::command(context_menu_command = "Test", slash_command, prefix_command)]
pub async fn test(
    ctx: Context<'_>,
    #[description = "test"] _user: User,
) -> CommandResult {
    Ok(())
}
Commands:
  /help        Show this menu
  
Test bottom text

Running /help test doesn't work either, saying "No such command test"

@kangalio
Copy link
Collaborator

Hmm, I cannot reproduce. The /test command shows up in the help menu and /help test works too.

Did you add the command to the framework with .command(test(), |f| f)?

@vicky5124
Copy link
Contributor Author

On further investigation, i appears to show up only if prefix_command is added to the macro, if it's just context menu by itself or cm+slash command, it won't show up.

@kangalio
Copy link
Collaborator

kangalio commented Oct 12, 2021

That checks out. The help command currently iterates through the prefix commands only. My logic was that the user can already see all slash commands and context menu commands within the Discord UI.

Though it's probably better to show all commands, that's less surprising. I'll add it to the todo list

@kangalio kangalio changed the title ContextMenu commands don't show up on the sample help. Only prefix commands show up in help menu Nov 11, 2021
@vicky5124
Copy link
Contributor Author

This issue is not over, context menu commands don't show up.
And as an additional issue, dynamic prefixes don't show in help either.

00 58 53_05-12-2021

And I have a feeling that over 1 in length prefixes will not align the description text.

@kangalio kangalio reopened this Dec 6, 2021
@kangalio
Copy link
Collaborator

kangalio commented Dec 6, 2021

Technically, these are three separate issues 😄 I'll see if I can fix them quickly

@kangalio
Copy link
Collaborator

kangalio commented Dec 6, 2021

What do you think of this output for context menu commands?

Commands:
  /help        Show this help menu
  /vote        Vote for something
  /getvotes    Retrieve number of votes
  /add         Add two numbers
  /choice      Dummy command to test slash command choice parameters
  /boop        Boop the bot!
  /delete      Deletes the given message
  /user_info   Query information about a Discord profile
  /echo        Echo content of a message
  /greet       Greet a user. Showcasing autocomplete!

Context menu commands:
  User information (on user)
  Echo (on message)

This is an example bot made to showcase features of my custom Discord bot framework

@vicky5124
Copy link
Contributor Author

Great! But, how will it fair with command descriptions? How does /help command name get affected by this? Will it be case-insensitive, or will the user have to write the command name entirely as is?

@kangalio
Copy link
Collaborator

kangalio commented Dec 6, 2021

Good point, thanks for noticing that. I made it case-insensitive, and you can refer to commands by either their prefix, slash, or context menu name
Screenshot_20211206_215556

@kangalio
Copy link
Collaborator

kangalio commented Dec 6, 2021

Implemented in f533fdd d016c78 90a1ef0 c90727c

@kangalio kangalio closed this as completed Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants