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

332
Views
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
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!