I was making a discord bot with the prefix "!c", but I wanted that if people sent "!c" that an embed showed up so I fixed it by doing this:
client = commands.Bot(command_prefix='!')
client.remove_command("help")
@client.group()
async def c(ctx):
YourEmbedCodeHere
I want to add a command "!c help" that it sends the same embed. I tried it by doing:
@c.group(invoke_without_command= True)
async def help(ctx):
embed = discord.Embed(title="ChiBot", description="ChiBot by Chita! A very usefull moderation, level, invite and misc bot!", color=0x62e3f9)
embed.add_field(name="Commands:", value="Do !help (command) to get help on that command!", inline=False)
embed.add_field(name="Misc", value="!c help !c randomimage !c invite !c echo", inline=False)
embed.add_field(name="Moderation", value="!c ban !c kick !c warn !c mute !c unmute !c warns !c warnings", inline=False)
embed.add_field(name="Levels", value="!c rank !c dashboard ", inline=False)
embed.add_field(name="Invites", value="!c invites (help with setting it up)", inline=False)
embed.set_footer(text="Created by Chita#8005")
await ctx.send(embed=embed)
But when I try that, it sends double because "!c" is still a command for that same embed. How can I make it so it only sends 1 embed? And I want to add other "!c" commands as well so I need a solution to remove the !c embed if there is something behind the !c
Regards,
Chita
question from:
https://stackoverflow.com/questions/65938520/sending-a-message-when-prefix-was-send-discord-py 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…