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

Not able to use dpytest for hybrid commands #126

Open
aarti98 opened this issue Jan 23, 2024 · 0 comments
Open

Not able to use dpytest for hybrid commands #126

aarti98 opened this issue Jan 23, 2024 · 0 comments

Comments

@aarti98
Copy link

aarti98 commented Jan 23, 2024

Recently, we added hybrid commands in our project and it is working alright. But since we converted few commands into autocomplete commands using @hybrid_command, respective test cases are failing with simple assertion error:
dpytest-error

If i try to sync my commands with this code:

@b.event
   async def setup_hook():  # type: ignore
       """Hooking setup."""
       print(f"{b.user} is now running!")
       for cog in settings.COGS_LIST:
           await b.load_extension(cog)
           print(f"Loaded Cog: {cog}")
           await b.tree.sync()

   # await b.start(settings.DISCORD_BOT_TOKEN_STAGING)
   await b._async_setup_hook()  # noqa: SLF001 # type: ignore
   await b.setup_hook()
   dpytest.configure(b)
   yield b

   # Teardown
   await dpytest.empty_queue()

I get the following error:

discord.app_commands.errors.MissingApplicationID

How can I add test cases for hybrid command in dpytest?

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

1 participant