poise icon indicating copy to clipboard operation
poise copied to clipboard

autocomplete broke up when there's another command having same name using rename macro

Open B-2U opened this issue 10 months ago • 6 comments

In my case, I want to make a command's prefix and slash seperately, like belowed

#[poise::command(slash_command, rename = "test")]
pub async fn test_slash(
    ctx: Context<'_>,
    #[autocomplete = "autocomplete_number11"]
    args: Option<u64>,
) -> Result<(), Error> {
    Ok(())
}

#[poise::command(prefix_command)]
pub async fn test(ctx: Context<'_>, #[rest] args: Option<Args>) -> Result<(), Error> {
    Ok(())
}

and the autocomplete wouldn't work, nor

#[poise::command(slash_command)]
pub async fn test(
    ctx: Context<'_>,
    #[autocomplete = "autocomplete_number11"]
    args: Option<u64>,
) -> Result<(), Error> {
    Ok(())
}

#[poise::command(prefix_command, rename = "test")]
pub async fn test_prefix(ctx: Context<'_>, #[rest] args: Option<Args>) -> Result<(), Error> {
    Ok(())
}

or is there a better way to do what I trying to do?

thank you so much

B-2U avatar Aug 11 '23 17:08 B-2U