Is there a way to get a Discord video (attachment) thumbnail?

hii, is there a way to get a Discord video (attachment) thumbnail, I found something that maybe can work but it didn't work so I'm here, here's my current code:
client.on('messageCreate', async message => {
const prefix = "tr.";
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(message.content.toLowerCase().startsWith(prefix))
{
if(command === "test"){

const videoUrl = 'https://cdn.discordapp.com/attachments/882020253129928744/1088897611584520262/images_1.mp4';

VideoResolver.resolve(videoUrl).then(videoInfo => {
const embed = new MessageEmbed()
.setTitle('video')
.setImage(videoInfo.thumbnail.url)
.setURL(videoUrl);
message.channel.send({ embeds: [embed] });
}).catch(error => {
console.error(error);
});
}
}
})
client.on('messageCreate', async message => {
const prefix = "tr.";
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(message.content.toLowerCase().startsWith(prefix))
{
if(command === "test"){

const videoUrl = 'https://cdn.discordapp.com/attachments/882020253129928744/1088897611584520262/images_1.mp4';

VideoResolver.resolve(videoUrl).then(videoInfo => {
const embed = new MessageEmbed()
.setTitle('video')
.setImage(videoInfo.thumbnail.url)
.setURL(videoUrl);
message.channel.send({ embeds: [embed] });
}).catch(error => {
console.error(error);
});
}
}
})
sorry if my question doesn't seem to make sense
10 Replies
Unknown User
Unknown Userā€¢2y ago
Message Not Public
Sign In & Join Server To View
Idris
Idrisā€¢2y ago
you cannot have videos in embeds only images
TRKako
TRKakoOPā€¢2y ago
no, i don't want to put a video in embed I want to get his thumbail and put that in .setImage()
Idris
Idrisā€¢2y ago
ah ok well if videoInfo.thumbnail.url correctly returns an image url it should try to console.log it
TRKako
TRKakoOPā€¢2y ago
VideoResolver.resolve(videoUrl).then(videoInfo => {
^

TypeError: Cannot read properties of undefined (reading 'resolve')
VideoResolver.resolve(videoUrl).then(videoInfo => {
^

TypeError: Cannot read properties of undefined (reading 'resolve')
šŸ˜¬šŸ˜¬šŸ˜¬šŸ˜¬ didn't expect that
Idris
Idrisā€¢2y ago
cannot help you as it's not discord.js
TRKako
TRKakoOPā€¢2y ago
do you think there's a way to do this using discord.js FeelsBadMan
Idris
Idrisā€¢2y ago
do you really think you could get a YouTube video with a Discord API wrapper?
TRKako
TRKakoOPā€¢2y ago
no, I mean, I want to get thumbnail of a video but a Discord video, no youtube, like this
chewie
chewieā€¢2y ago
considering that you don't get any useful data besides the attachment name, url etc. I doubt you can really you probably have to download the video and go from there
Want results from more Discord servers?
Add your server