Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

676
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda