Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

168
Views
¿Cómo podemos agregar js usando discord.js usando mecanografiado?

En el

message.channel.send(output, {code: "js"});

código siempre dice

Expected 1 arguments, but got 2.

lo que hace el {código: "js"} es que agrega `````` al código, ¿cómo soluciono esto?

tenga en cuenta que estoy usando el controlador WOKCommand.

 import { ICommand } from "wokcommands"; import { Client, Message, MessageEmbed } from "discord.js"; import { inspect } from "util" export default { category: 'Moderation', description: 'Deletes multiple messages at once.', ownerOnly: true, maxArgs: 1, expectedArgs: '[amount]', slash: false, callback: async ({client, message, args}) => { if (message.author.id !== '763857069413367878') return; const code = args.join(" "); if(!code) return `Please provide some code to evaluate` try { const result = await eval(code); let output = result; if(typeof result !== 'string') { output = inspect(result) } message.channel.send(output, {code: "js"}); } catch (error) { message.channel.send('Evaluated some code but to long!') }; }, } as ICommand
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

En las versiones más nuevas de discord.js, ahora debe pasar todo en un objeto.

Esto se puede hacer así:

 message.channel.send({content: output, code: "js"});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!