Skip to content

Send attachments/images/files to channel #30

Answered by rigwild
toastyy00 asked this question in Q&A
Discussion options

You must be logged in to vote

It is possible, but I will not include the attachment upload in the lib.

  1. Upload attachments

API doc: https://discord.com/developers/docs/reference#uploading-files

You can also upload your image manually, then get its data in devtools at API call POST /channels/<channel_id>/attachments and copy its response data

  1. Send a normal message and pass the attachment ID
{
  // Attachment API response
  const attachmentsRes = {
    attachments: [
      {
        id: 114,
        upload_url:
          'https://discord-attachments-uploads-prd.storage.googleapis.com/445349b3-0ef1-4e9d-be5c-1e782ac91de7/2022-02-15_12-06-24.png?upload_id=ADPycdtgy9J9bNZAj695f42Wpi5iiK1wTIwuBmqLi73-usKE8SFHxPTOwk3656xE…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by toastyy00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants