【问题标题】:Is there a way to make only two items be on an embed inline? (Discord.js)有没有办法让嵌入内联中只有两个项目? (不和谐.js)
【发布时间】:2022-07-16 14:04:32
【问题描述】:

正如标题所暗示的,我想知道是否有任何方法可以做到这一点,因此每行只有 2 个项目用于嵌入不和谐而不是 3 个。目标是这样的 -

Item 1 -        Item 2 -
(Description)   (Description)

Item 3 -        Item 4 -
(Description)   (Description)

Item 5 -        Item 6 -
(Description)   (Description)

感谢您的宝贵时间。

【问题讨论】:

    标签: discord.js formatting inline


    【解决方案1】:

    您可以使用.addField('\u200b', '\u200b') 创建一个空字段

    const embed = new MessageEmbed()
      .setColor('RANDOM')
      .addField('Item 1 -', '(Description)', true)
      .addField('Item 2 -', '(Description)', true)
      .addField('\u200b', '\u200b')
      .addField('Item 3 -', '(Description)', true)
      .addField('Item 4 -', '(Description)', true)
      .addField('\u200b', '\u200b')
      .addField('Item 5 -', '(Description)', true)
      .addField('Item 6 -', '(Description)', true)
    
    message.channel.send({
      embeds: [embed]
    })
    

    编辑:

    const embed = new MessageEmbed()
      .setColor('RANDOM')
      .addField('Item 1 -', '(Description)', true)
      .addField('Item 2 -', '(Description)', true)
      .addField('** **', '** **')
      .addField('Item 3 -', '(Description)', true)
      .addField('Item 4 -', '(Description)', true)
      .addField('** **', '** **')
      .addField('Item 5 -', '(Description)', true)
      .addField('Item 6 -', '(Description)', true)
    
    message.channel.send({
      embeds: [embed]
    })
    

    【讨论】:

    • 谢谢,这行得通,但是我有什么办法可以让行之间没有太大的差距?
    • 到目前为止,我还没有任何其他方法可以缩小差距,抱歉。
    • 我已经想通了在每个字段中放置一个小的空白区域。我希望你看到这个,检查我编辑的答案。
    猜你喜欢
    • 2019-12-12
    • 2021-06-20
    • 2021-05-19
    • 2020-09-22
    • 1970-01-01
    • 2023-04-04
    • 1970-01-01
    • 2020-07-21
    • 2019-09-27
    相关资源
    最近更新 更多