N/A on episode null value

master
Cristiano Pires 2 years ago
parent e008008ced
commit 07a108899e

@ -16,7 +16,7 @@ class anime extends Command{
}
async run(message, args){
const data = await new aniList().searchAnime(args.join(' '));
console.log(data)
const embed = new EmbedBuilder()
.setTitle(`${data.title.romaji} (${data.title.native} / ${data.title.english})`)
.setAuthor({name:"Rem-chan", iconURL:"https://i.imgur.com/g6FSNhL.png",url:'https://rem.wordfights.com/addtodiscord'})
@ -28,7 +28,7 @@ class anime extends Command{
.setTimestamp()
.addFields(
{name:'Status:', value:data.status, inline:true},
{name:'Episodes:', value:data.episodes.toString(), inline:true},
{name:'Episodes:', value:data.episodes?data.episodes.toString():'N/A', inline:true},
{name:'Trailer:', value:data.trailer?(data.trailer.site=='yotube'?`https://www.youtube.com/watch?v=${data.trailer.id}`:`https://www.dailymotion.com/video/${data.trailer.id}`):'N/A'});
const randomID = Random();
const row = new ActionRowBuilder()

Loading…
Cancel
Save