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

392
Views
Estoy tratando de hacer que el comando de barra responda usando discord js con imágenes adjuntas sin usar incrustar, pero parece que no puedo hacerlo bien

Quiero hacerlo para que mi bot pueda responder al comando de barra con imágenes. mi plan aquí es usar MessageAttachment para obtener la URL de las imágenes y llamarlo usando la interacción de espera. Este es el error que obtengo de los registros.

estoy usando dicord js v13

 2021-09-24T03:27:36.954175+00:00 app[service.1]: at Object.execute (/app/commands/cook.js:13:27) 2021-09-24T03:27:36.954175+00:00 app[service.1]: at Client.<anonymous> (/app/index.js:28:17) 2021-09-24T03:27:36.954176+00:00 app[service.1]: at Client.emit (node:events:394:28) 2021-09-24T03:27:36.954177+00:00 app[service.1]: at InteractionCreateAction.handle (/app/node_modules/discord.js/src/client/actions/InteractionCreate.js:66:12) 2021-09-24T03:27:36.954178+00:00 app[service.1]: at Object.module.exports [as INTERACTION_CREATE] (/app/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36) 2021-09-24T03:27:36.954178+00:00 app[service.1]: at WebSocketManager.handlePacket (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:345:31) 2021-09-24T03:27:36.954179+00:00 app[service.1]: at WebSocketShard.onPacket (/app/node_modules/discord.js/src/client/websocket/WebSocketShard.js:443:22) 2021-09-24T03:27:36.954179+00:00 app[service.1]: at WebSocketShard.onMessage (/app/node_modules/discord.js/src/client/websocket/WebSocketShard.js:300:10) 2021-09-24T03:27:36.954180+00:00 app[service.1]: at WebSocket.onMessage (/app/node_modules/ws/lib/event-target.js:132:16) 2021-09-24T03:27:36.954180+00:00 app[service.1]: at WebSocket.emit (node:events:394:28)

Aquí está mi código

 const { SlashCommandBuilder } = require('@discordjs/builders'); const { Message, MessageAttachment } = require('discord.js'); module.exports = { data: new SlashCommandBuilder() .setName('cook') .setDescription('aaa'), async execute(interaction) { const imagecook = new MessageAttachment('https://cdn.discordapp.com/attachments/587243063932354560/861940902359728128/gurucooking_long.png'); await interaction.replay({attachment: [imagecook]});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Creo que simplemente escribiste mal replay porque debería ser interaction.reply()

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!