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

336
Vistas
My discord bot that can copy/paste messages from one channel to another, how do I make it copy the attachment as well?

This is the code I have written so far. It works but I can seem to understand how to grab the attachment of the post and include it in the copy/pasted message. Would something like let attachment = context.params.event.attachments; work?

// authenticates you with the API standard library
// type `await lib.` to display API autocomplete
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});

let channel = context.params.event.channel_id;
let msg = context.params.event.content;
let member = context.params.event.author.id;
if (context.params.event.content.startsWith(`Alerts`)) {
  await lib.discord.channels['@0.3.0'].messages.create({
    channel_id: `948355963495272458`,
    content: `<#${channel}> <@${member}> **| ${msg}**`
  });
  
}

about 4 years ago · Juan Pablo Isaza
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