Responding to interaction with a video from a URL
Hi,
I have a database of videos that are all stored as links (all on the discord CDN and ending in .mp4). I want to respond to a ChatInputCommandInteraction with a video.
At the moment I'm doing
await i.reply({files: [new Attachment({url: row.content})]})
, but that re-uploads the video to the Discord CDN rather than just showing it from the URL, which makes it slower. With images I know you can just provide a url and not have to reupload it, I assume this is possible with videos too? And also Attachment's constructor is private so its not ideal.
Is there a "more ideal" way to do this, that's efficient and works?4 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.Anything you send through
files
will go through the CDN directly
You can just send the url in teh message content, but unlike messages, embedded videos do not replace the content; instead, the url will still be visible in the content, but the video will be embedded (assuming the bot has the Embed Files permission)
Btw, AttachmentBuilder
is the class with a public constructorah right. I was thinking like how in the image field of embeds you can specify a URL and it will use that url, rather than fetching the image and re-uploading it - I assume it's not possible to do anything like that with videos, and only option is to re-upload it (or just put url in content, but i don't want to do that)?
Yeah you can't send videos in embeds