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);
});
}
}
})