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

400
Vistas
iam trying to make slash command reply using discord js with attachment images without using embed but cant seems to make it right

I want to make it so my bot can reply to the slash command with images. my plan here is to use MessageAttachment to get the images URL and call it using await interaction. This is the error I am getting from logs

iam using 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)

Here is my code

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

0

I think you just misspelled replay because it should be interaction.reply()

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