【发布时间】:2021-02-28 20:16:21
【问题描述】:
我正在制作一个带有各种命令的机器人。这些命令之一应该是进行嵌入。比如你在哪里说命令、标题和描述。但是机器人只能以一个词作为标题,一个词作为描述。我需要帮助,我的代码在下面使用。 (toob是前缀)
@client.command()
async def makeEmbed(ctx, title: str, description : str):
if not title:
await ctx.channel.send("One or more values are missing. Command should look like 'toob makeEmbed (title), (description)'")
elif not description:
await ctx.channel.send("One or more values are missing. Command should look like 'toob makeEmbed (title), (description)'")
embed = discord.Embed(title=title, description=description, color=0x72d345)
await ctx.send(embed=embed)
【问题讨论】:
-
也许使用
toob makeEmbed "title with multiple words" "description with multiple words"。
标签: python discord bots discord.py discord.py-rewrite