【发布时间】:2021-05-02 10:21:00
【问题描述】:
我正在制作一个前缀为“!c”的不和谐机器人,但我希望如果人们发送“!c”,嵌入就会出现,所以我通过这样做来修复它:
client = commands.Bot(command_prefix='!')
client.remove_command("help")
@client.group()
async def c(ctx):
YourEmbedCodeHere
我想添加一个命令“!c help”,它发送相同的嵌入。我试过这样做:
@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)
但是当我尝试这样做时,它会发送双精度,因为“!c”仍然是同一嵌入的命令。我怎样才能使它只发送1个嵌入?而且我还想添加其他“!c”命令,因此如果 !c 后面有东西,我需要一个解决方案来删除 !c 嵌入
问候, 赤塔
【问题讨论】:
标签: discord bots discord.py