I'm trying to convert my Discord Bot commands to hybrid commands. When I don't use the hybrid_command decorator, the slash commands work.
The error says the callback must be a coroutine. What does it mean? What am I missing in the code?
main.py
class MyBot(commands.Bot):
def __init__(self):
intents=discord.Intents.all()
intents.message_content = True
super().__init__(
command_prefix='!',
intents=discord.Intents.all()
)
self.initial_extensions = [
"cogs.user_commands"
]
async def setup_hook(self):
for ext in self.initial_extensions:
await self.load_extension(ext)
await bot.tree.sync(guild = discord.Object(id=191453821174531128))
user_commands.py
class user_commands(commands.Cog):
def __init__(self, bot):
self.bot = bot
bot.remove_command("help")
@commands.hybrid_command(name='help', with_app_command=True)
@app_commands.command()
async def help(self, interaction: discord.Interaction, command: Optional[str]):
......
await interaction.response.send_message(embed=embed, ephemeral = True)
@help.autocomplete('command')
async def help_autocomplete(self,
interaction: discord.Interaction,
current: str,
) -> List[app_commands.Choice[str]]:
.....
Error:
