#help command not loading

1 messages · Page 1 of 1 (latest)

tacit ravine
#
import disnake
from disnake.ext import commands
from better_profanity import profanity
import base64
import time
from io import BytesIO
from disnake.ext import commands
import random

class Help(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        self.color_list = [0x3498db, 0xe74c3c, 0x2ecc71, 0xf1c40f, 0x9b59b6, 0xe67e22, 0x1abc9c, 0xe74c3c, 0x34495e, 0x2ecc71]


@commands.slash_command(description="This code is run every time any subcommand is invoked")
async def cmd(self, ctx: disnake.ApplicationCommandInteraction):
        pass

@cmd.sub_command(description="get help")
async def help(self, ctx: disnake.ApplicationCommandInteraction):
    embed = disnake.Embed(title="Command Help", description="List of available commands", color=0x00ff00)

    # Add fields for each command
    embed.add_field(name="/user fetch <name>", value="Fetch user information", inline=False)
    embed.add_field(name="/mod ban <user>", value="Ban a user", inline=False)
    embed.add_field(name="/mod kick <user>", value="Kick a user", inline=False)
    embed.add_field(name="/poll start <question>", value="Start a poll", inline=False)
    embed.add_field(name="/ai art <text> <model>", value="Generate AI art", inline=False)
    embed.add_field(name="/music disconnect", value="Disconnect the bot from the voice channel", inline=False)
    embed.add_field(name="/music play <song>", value="Play a song", inline=False)
    embed.add_field(name="/music skip", value="Skip the current song", inline=False)
    embed.add_field(name="/cmd help", value="Display this help message", inline=False)

    # Send the Embed as a message
    await ctx.response.send_message(embed=embed)

  
def setup(bot: commands.Bot):
    bot.add_cog(Help(bot))
#
import disnake
import disnake
from disnake import *
from disnake.ext import commands
from better_profanity import profanity
import base64
import time
from io import BytesIO
from disnake.ext import commands
import random

class help(commands.Cog):
    def __init__(self, bot):
        self.bot = bot



@commands.slash_command(description="This code is run every time any subcommand is invoked")
async def cmd(self, ctx: disnake.ApplicationCommandInteraction):
     pass

@cmd.sub_command(description="Get help")
async def helpme(self, inter: disnake.ApplicationCommandInteraction):
        embed = disnake.Embed(title="Slash Commands Help", color=random.choice(self.bot.color_list))
        embed.set_thumbnail(url=self.bot.user.display_avatar.url)
        description = "```fix\nCommand arguments - <required> [optional]```\n"
        for cog in self.bot.cogs.values():
            for command in cog.__cog_app_commands__:
                description += "`/" + command.name
                for option in command.options:
                    if option.required:
                        description += f" <{option.name}>"
                    else:
                        description += f" [{option.name}]"
 
                description += f"` - {command.description}\n"
        embed.description = description
        await inter.send(embed=embed, ephemeral=True)

def setup(bot: commands.Bot):
    bot.add_cog(help(bot))```
#

my firend sent me this to use it but is dose not work

tacit ravine
#

Anyone

lilac valley
#

uhm you know about indentation in python right?

#

your commands are outside the Help class

#

so they are not inside the cog

#

so the cog that you are loading is empty

tacit ravine
#

oh ok

tacit ravine