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

404
Visualizações
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 Respostas
Responde à pergunta

0

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

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