From 5937cbbeabb68f275c187b968d3b753419bc2875 Mon Sep 17 00:00:00 2001 From: masterhc Date: Thu, 8 Feb 2024 23:48:34 +0000 Subject: [PATCH] Handle lack of gender and description --- commands/search/searchChar.js | 5 ++++- lib.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/commands/search/searchChar.js b/commands/search/searchChar.js index 44d3690..2f632ca 100644 --- a/commands/search/searchChar.js +++ b/commands/search/searchChar.js @@ -72,13 +72,16 @@ class char extends Command{ .setThumbnail(data.image) .setTimestamp() .addFields( - {name:'Gender:', value:data.gender, inline:true}, {name:'Page', value:data.url, inline:true} ); if(data.age) { embed.addFields({name:'Age:',value:data.age, inline:true}); } + if(data.gender) + { + embed.addFields({name:'Gender:', value:data.gender?data.gender:'', inline:true},); + } if(!data.name.native) { embed.setTitle(`${data.name.full}`) diff --git a/lib.js b/lib.js index b8e73e7..78aabdc 100644 --- a/lib.js +++ b/lib.js @@ -839,7 +839,7 @@ class AnilistCli { gender:data.Character.gender, url:data.Character.siteUrl, image:data.Character.image.medium, - description:data.Character.description, + description:data.Character.description?data.Character.description:' ', age:data.Character.age, }