#Parser Expected Error

1 messages · Page 1 of 1 (latest)

desert owl
#

I'm getting the error "The parser expected to find a '}' to match the '{' token here."

#
client.on('interactionCreate', async (interaction) => {
    if (!interaction.isCommand()) {
        return
    }
    const{ commandName, options} = interaction
})

client.on('interactionCreate', async (interaction) => {
    if (!interaction.isCommand()) {
        return
    }

    const{ commandName, options} = interaction

    if (commandName === 'bid') {

            const bid_ammount_usd = options.getNumber('bid_ammount_usd')
            
            interaction.reply({
                ephemeral: true,
                content: [],
                "content": "",
    "tts": false,
    "embeds": [
      {
        "title": "🔥New bid🔥",
        "description": "",
        "color": 0xfd7272,
        "fields": [
          {
            "name": "\u200B",
            "value": "**Bid** • $100.00 ",
            "inline": true
          },
          {
            "name": "\u200B",
            "value": "⋮",
            "inline": true
          },
          {
            "name": "\u200B",
            "value": `**Bidder** • `,
            "inline": true
          },
          {
            "name": "\u200B",
            "value": "**✅ Price Increase** • +$50.00"
          },
          {
            "name": "\u200B",
            "value": "**💰 Currency** • Crypto"
          }
        ],
        "footer": {
          "text": "Anonymouse Snipez"
        }
            
        }) //<--- Here it says ','expected.
    }
})

client.login(process.env.TOKEN)
minor dirge
#

seems like a syntax error

desert owl
#

yeah

#

here is the full error

minor dirge
#

you didn't close your embed array ]

desert owl
#

where do I close it

minor dirge
#

please learn js

#

this is a syntax error, and not related to djs

desert owl
#

ok

#

I did close it

minor dirge
#

no you didn't

desert owl
#

wait

#

nvm

minor dirge
#

your embed array and object hasn't been closed

desert owl
#

youre right

#

An object literal cannot have multiple properties with the same name.

#

I got this error now

minor dirge
#

why do you have content: [] and "content": ""

#

if you don't need to use content, don't add the property

desert owl
#

youre right

#

💀

#

im getting this error now

C:\Users\leona\OneDrive\Desktop\development\discord\Bidding Bot\node_modules\discord.js\src\util\Util.js:417
    if (!allowEmpty && data.length === 0) throw new error(errorMessage);
                                                ^
RangeError [MESSAGE_CONTENT_TYPE]: Message content must be a non-empty string.
    at Function.verifyString (C:\Users\leona\OneDrive\Desktop\development\discord\Bidding Bot\node_modules\discord.js\src\util\Util.js:417:49)
    at MessagePayload.makeContent (C:\Users\leona\OneDrive\Desktop\development\discord\Bidding Bot\node_modules\discord.js\src\structures\MessagePayload.js:114:22)
    at MessagePayload.resolveData (C:\Users\leona\OneDrive\Desktop\development\discord\Bidding Bot\node_modules\discord.js\src\structures\MessagePayload.js:129:26)
    at CommandInteraction.reply (C:\Users\leona\OneDrive\Desktop\development\discord\Bidding Bot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:97:50)
    at C:\Users\leona\OneDrive\Desktop\development\discord\Bidding Bot\index.ts:58:25
    at Generator.next (<anonymous>)
    at C:\Users\leona\OneDrive\Desktop\development\discord\Bidding Bot\index.ts:31:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\leona\OneDrive\Desktop\development\discord\Bidding Bot\index.ts:27:12)
    at Client.<anonymous> (C:\Users\leona\OneDrive\Desktop\development\discord\Bidding Bot\index.ts:47:54) {
  [Symbol(code)]: 'MESSAGE_CONTENT_TYPE'
#

yk how I could fix this

remote niche
#

Message content must be a non-empty string.

#

you have to either have something in the content or just not have the content: '' at all