Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

everything is correct but when i put : after value in this code

module.exports = {
    name: 'commands',
    description: 'command embed',
    execute(message, args, Discord) {
        const CommandsEmbed = new Discord.MessageEmbed()
        .setColor('#FFC100')
        .setTitle('Commands')
        .setURL('http://bitly.com/98K8eH')
        .setDescription('Embed showing every command')
        .addFields()
            {name: 'Playlist', value: 'Playlist - only for stoners'}
    }
};

and when i try to run it it shows me that ':' is an unexpected token. Can I fix it somehow? I was doing it basing on this tutorial https://www.youtube.com/watch?v=I7eZY-SBmf8&list=PLbbLC0BLaGjpyzN1rg-gK4dUqbn8eJQq4&index=5

question from:https://stackoverflow.com/questions/65645602/cant-set-the-value-in-discord-js

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
84 views
Welcome To Ask or Share your Answers For Others

1 Answer

You have to use this inside () of .addFields:

.addFields(
   {name: 'Playlist', value: 'Playlist - only for stoners'}
)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...