gpt4 book ai didi

python - 我如何在 Python 中嵌入的 Discord 中换行?

转载 作者:行者123 更新时间:2023-12-04 15:21:23 25 4
gpt4 key购买 nike

我试图在每个嵌入字段之间留出空间,我尝试使用 \u200B\n但这对我不起作用。 ( 使用 Python 创建 discord bot)

async def cmd_help(self, ctxt):
embed=discord.Embed(
color=ctxt.author.color,
description=f'All Command**{self.client.user.mention}**'
)
embed.set_author(name=self.client.user.name, icon_url=self.client.user.avatar_url)
embed.add_field(name='Server Command', value='`p!ping`>>Check the ping from server to bot.\n`p!list`>>Check the number of users in the server.', inline=False)
embed.add_field(name='Users Command', value='`!kick`>>Kick the user from server.', inline=False)
await ctxt.send(embed=embed)

最佳答案

由于您想在 2 个字段之间添加额外的空间,因此这是一个很好的解决方法:

embed.add_field(name='Server Command', value='`p!ping`>>Check the ping from server to bot.\n`p!list`>>Check the number of users in the server.',  inline=False)
embed.add_field(name = chr(173), value = chr(173))
embed.add_field(name='Users Command', value='`!kick`>>Kick the user from server.', inline=False)
我所做的是在它们之间添加了另一个字段,并将其名称和值设置为 空字符 .

关于python - 我如何在 Python 中嵌入的 Discord 中换行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63207164/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com