【问题标题】:Discord bot Embed not returning text as I wantedDiscord bot Embed 未按我的意愿返回文本
【发布时间】:2021-04-11 16:54:06
【问题描述】:

制作一个不和谐的机器人和这个命令,它应该返回一个嵌入但`破坏文本:

module.exports = {
        name: 'pain',
        description: 'Pain',
        execute(message, args) {
             const Discord = require('discord.js');
             const PainEmbed = new Discord.MessageEmbed()
            .setColor('#0099ff')
            .setTitle('Tears')
            .setAuthor('A fork')
            .setDescription(`
                If I showed you my teardrops,
                Would you collect them like rain,
                Store them in jars,
                That are labelled with "pain"
                Would you follow their tracks,
                From my eyes down my cheeks,
                As they write all the stories,
                I\`m too scared to speak,
                Would you stop them with kisses,
                Bring their flow to a halt,
                as you teach me that pain,
                Isen\`t always my fault,
                Would you hold my face gently,
                As you dry both my eyes,
                And whisper the words, 
                "You\`re too precious to cry",
                If I showed you my teardrops,
                Would you show me your own,
                And learn though we\`re lonely,
                We\`re never alone. `)
            .setFooter('Poem made by: ~e.h');
            message.channel.send(PainEmbed);
        },
    };

这是代码返回的内容:

我认为它返回了一个承诺,我必须解决这个承诺,但我不知道如何

【问题讨论】:

    标签: javascript node.js discord.js bots


    【解决方案1】:

    这非常简单,因为您使用的是 Discord 的代码块功能。 不太清楚你为什么使用 ` 而不是 ' 因为老实说,它看起来更好,而且在英语方面是正确的。

    Simply change it from ` to ' in the cases where you want an apostrophe.
    

    在这种情况下,您甚至不需要在 ' 之前使用 \。

    【讨论】:

      猜你喜欢
      • 2020-08-17
      • 2021-10-28
      • 2021-02-07
      • 2012-09-19
      • 2021-07-03
      • 1970-01-01
      • 2021-01-20
      • 2021-08-11
      • 2021-02-15
      相关资源
      最近更新 更多