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

Can't get the ID of a slash subcommand #1625

Closed
3 tasks done
LakshayGMZ opened this issue Sep 8, 2022 · 2 comments · Fixed by #1678
Closed
3 tasks done

Can't get the ID of a slash subcommand #1625

LakshayGMZ opened this issue Sep 8, 2022 · 2 comments · Fixed by #1678
Labels
unconfirmed bug A bug report that needs triaging

Comments

@LakshayGMZ
Copy link

LakshayGMZ commented Sep 8, 2022

Summary

I use bot.get_application_command method to get the id of a slash commands to mention

Reproduction Steps

I am currently making a custom help command for my bot which supports slash commands. I want to add mentioned slash commands in help embed for making it easy for users to use the command. await bot.get_application_command("comm_name") works absolutely fine on top level slash commands and returns ApplicationCommand.

But when i use a slash subcommand name like: "foo barr", It returns None even if the sub command is global. Tried adding type=discord.SlashCommandGroup parameter, but still no luck.

Minimal Reproducible Code

a = self.bot.get_application_command("parent subcommand", type=discord.SlashCommandGroup)
print(a)

Expected Results

returns ApplicationCommand Object

Actual Results

returns None

Intents

member_content

System Information

  • Python v3.9.6-final
  • py-cord v2.1.1-final
  • aiohttp v3.7.4.post0
  • system info: Windows 10 10.0.22000

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

@LakshayGMZ LakshayGMZ added the unconfirmed bug A bug report that needs triaging label Sep 8, 2022
@Dorukyum
Copy link
Member

Dorukyum commented Sep 8, 2022

The ID is the same as the parent because subcommands behave like options in the API, but I get that get_command should also look for subcommands. Will add that.

@Lulalaby
Copy link
Member

Status Update please
@Pycord-Development/maintainers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unconfirmed bug A bug report that needs triaging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants