-
Sujet
-
Code :
Erreur :def __init__(self, bot: commands.Cog): super().__init__( placeholder="Choose a category", options=[ discord.SelectOption( label=cog_name, description=cog.__doc__ ) for cog_name, cog in bot.cogs.items() if cog.__cog_commands__ and cog_name not in ['Jishaku'] ] ) self.bot = bot async def callback(self, interaction: discord.Interaction) -> None: cog = self.bot.get_cog(self.values[0]) assert cog commands_mixer = [] for i in cog.wlak_commands(): commands_mixer.append(i) for i in cog.walk_app_commands(): commands_mixer.append(i) embed = discord.Embed( title=f"{cog.__cog_name__} Commands", description='n'.join( f"**{command.name}**: `{command.description}`" for command in commands_mixer ) ) await interaction.response.send_message( embed=embed, ephemeral=True ) class Utils(commands.Cog): def __init__(self, bot): self.bot = bot @bot.command(name='help', description='Shows list of commands') async def help(self, ctx: commands.Context): embed = discord.Embed( title="Help command", description="This is help command Skayzon" ) view = View().add_item(HelpSelect(self.bot)) await ctx.send(embed=embed, view=view) @bot.command(name='test', description='this is test command') async def test(self, ctx: commands.Context): await ctx.send(10) async def setup(bot): await bot.add_cog(Utils(bot))
——————–
‘ $kayzonn} – Envoyé depuis le Discord : Culte du code
Vous lisez 12 fils de discussion
Vous lisez 12 fils de discussion
- Vous devez être connecté pour répondre à ce sujet.