Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

685
Visualizações
SyntaxError: Unexpected token 'const' on node.js (discord.js)

The "const" tag is not working on discord.js for a discord bot.

The code is being refered to this the "aboutembed". I don't know what is wrong with the code.

May someone please help? Thanks.

C:\Users\alext\OneDrive\Documents\Toast\index.js:10
const aboutembed = new Discord.MessageEmbed({
^^^^^

SyntaxError: Unexpected token 'const'
←[90m    at Object.compileFunction (node:vm:352:18)←[39m
←[90m    at wrapSafe (node:internal/modules/cjs/loader:1033:15)←[39m
←[90m    at Module._compile (node:internal/modules/cjs/loader:1069:27)←[39m
←[90m    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)←[39m
←[90m    at Module.load (node:internal/modules/cjs/loader:981:32)←[39m
←[90m    at Function.Module._load (node:internal/modules/cjs/loader:822:12)←[39m
←[90m    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)←[39m
←[90m    at node:internal/main/run_main_module:17:47←[39m
const Discord = require('discord.js');
const request = require('request');
const fetch = require('node-fetch');
require('dotenv-flow').config();

const client = new Discord.Client();

var prefix = !!

const aboutembed = new Discord.MessageEmbed({
    title: "Food Bot",
    fields: [
        {
            name: "Author",
            value: "This bot is made by **AlexToucanYT#0001** on Discord, copyrighted by AT Products LLC."
        },
        {
            name: "Commands",
            value: "https://raw.githubusercontent.com/Alex-Toucan/Food-bot/master/files/commands.txt"
        }
    ],
    color: "GREY"
})

client.on('message', msg => {
  if(msg.content.toLowerCase() === '${prefix}help') {
    msg.reply({ embed: aboutembed });
    }
 });

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

const client = new Discord.Client();

var prefix = '!!';

The issue in the live var prefix = !!

First of all it doesn't have ; at the end, and last but not least !! is invalid sign in JS.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda