Is there a way to recall a cog slash command from a cog slash command? #101
-
Example:
Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
just call the callback of the setup command just like a normal method For example class MyCog:
...
@cogs.slash_cog(...)
async def setup(self, ctx):
# your command code
@cogs.slash_cog(...)
async def other_command(self, ctx):
if user in db:
pass
else:
# call the setup function
await self.setup(ctx)
return This will run the setup command as if it was used as a slash command |
Beta Was this translation helpful? Give feedback.
-
okay, seems that there's an issue with directly calling cog commands with ...
await self.setup.invoke(ctx) # instead of await self.setup(ctx) sorry for the trouble |
Beta Was this translation helpful? Give feedback.
okay, seems that there's an issue with directly calling cog commands with
()
, sorry for that, until it's fixed this should be a workaroundsorry for the trouble