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

No ability for global and guild commands with the same name. #139

Open
4 tasks done
TheUntraceable opened this issue May 23, 2022 · 4 comments
Open
4 tasks done

No ability for global and guild commands with the same name. #139

TheUntraceable opened this issue May 23, 2022 · 4 comments

Comments

@TheUntraceable
Copy link
Member

Summary

You can't have a guild command with the same name as a guild command and the other way round.

Reproduction Steps

The command handler will only call the callback of the first found command in the list.

Minimal Reproducible Code

@client.command(
    guild_ids = ["937364424208039957"]
)
async def ping(interaction):
    """Replies with Pong!"""
    return await interaction.reply(content = "Pong!") # Lying is a bad thing.

@client.command()
async def ping(interaction):
    """Replies with Pong!"""
    return await interaction.reply(content = "Pong!") # Just because this is the second command doesn't mean we can lie.

Expected Results

Not too sure actually.

Actual Results

It'll call a single command... yeah I don't know how to go about this

Intents

No response

System Information

All.

Checklist

  • This bug was found on the latest version of EpikCord
  • You have checked that there is no issue already mentioning this bug, open or closed
  • Full details of the bug have been provided/shown, including full tracebacks in case of exceptions
  • All bot tokens have been hidden/omitted from any screenshots or code, if any

Additional Context

No response

@nav-github01001
Copy link
Member

I think we can safely flag this as 'unintended behaviour 'because the first command overwrites the other command. Or we may do this
{"global": commands, "guild_id": commands}

@nav-github01001
Copy link
Member

@TheUntraceable

@EmmmaTech
Copy link

You can't have a guild command with the same name as a guild command and the other way round.

The title of this issue contradicts what you said here. Did you mean "global" instead of "guild"?

Also, looking at your example, the "newer" version of that ping callback would override the other. Probably not that relevant but just pointing it out.

@TheUntraceable
Copy link
Member Author

What is meant by this is, if the developer tries to add 2 commands with the same name, where one of them is global, the other is a guild, the latest commands callback is always called I'd assume, and so we need to be able to differentiate between what command is being called, as we before only get by name.

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