I've tried many possible solutions to these subcommands but I can't find the issue.
@client.command(aliases=['commands', 'Commands', 'Help'])
async def help(ctx, command=None):
if command == None:
author = ctx.message.author
embed = discord.Embed(colour=discord.Colour.magenta())
embed.set_author(name='Help Command')
embed.add_field(name='Here are all the commands!',
value='If you want to know how to use a command, do ``;help <command name>`` *--coming soon--*',
inline=False)
embed.add_field(name='Miscellaneous',
value='``8ball``, ``flip``, ``userinfo``, ``drip``, ``annoy``, ``hug``, ``slap``, ``cry`` ``pat``, ``punch``, ``invite``',
inline=False)
embed.add_field(name='
Information', value='``userinfo``, ``avatar``, ``rules``', inline=False)
embed.add_field(name='
Moderation',
value='``kick``, ``ban``, ``unban``, ``mute``, ``unmute``, ``report``, ``clear``', inline=False)
await ctx.author.send(embed=embed)
await ctx.send(f'***? {author.mention} Check your DMs!***')
if command == '8ball':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='8ball command', value='A random yes/no answer. ``;8ball <question>``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'flip':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Flip command', value='Flips a coin. ``;flip <question>``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'userinfo':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Userinfo command', value='Displays user information. ``;userinfo``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'drip':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Drip command', value='Shows you the real drip. ``;drip``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'annoy':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Annoy command', value='Pings a user 10 times. ``;annoy user``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'hug':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Hug command', value='Hugs the user. ``;hug <user>``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'slap':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Slap command', value='Slaps the user. ``;slap <user>``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'cry':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Cry command', value='You cry. ``;cry``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'pat':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Pat command', value='Pats user``;pat <user>``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'punch':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Punch command', value='Punches user. ``;punch <user>``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'invite':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Invite command', value='Gives you the permanent invite link. ``;invite``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'userinfo':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Userinfo command', value='Shows information about user``;userinfo <user>``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'avatar':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Avatar command', value='Shows users avatar. ``;avatar <user>``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'rules':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Rules command', value='Shows you server rules. ``;rules``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'kick':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Kick command', value='Kicks mentioned user. ``;kick <user>``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'ban':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Ban command', value='Bans mentioned user. ``;ban <user>``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'unban':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Unban command', value='Unbans user. ``;unban <user tag(name#0001)>``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'mute':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Mute command', value='Mutes mentioned user. ``;mute <user>``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'unmute':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Unmute command', value='Unmutes mentioned user. ``;unmute <user>``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'clear':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Clear command', value='Clears recent messages. ``;clear <amount>``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
if command == 'report':
embed = discord.Embed(colour=discord.Colour.magenta())
embed.add_field(name='Report command', value='Reports user to staff team. ``;report <grade (mild / severe / urgent)> <user> <reason>``')
embed.thumbnail(url='https://cdn.discordapp.com/attachments/801233629954048040/802533814282879026/e39-min.png')
embed.set_footer(icon_url=ctx.author.avatar_url, text=f'Requested by {ctx.author.name}')
await ctx.author.send(embed=embed)
return
Is there any fix out there to this? I couldn't find one myself.
';help' is the normal command to get all the commands. Subcommands would be ';help userinfo', ';help rules', etc. I've asked around in the discord.py discord server, and I've also tried going the the official Python discord server to get help. But nothing seems to work. Any fixes?
Any help would be awesome :)
question from:
https://stackoverflow.com/questions/65870440/discord-python-subcommands-arent-working