diff --git a/commands/search/searchAnime.js b/commands/search/searchAnime.js index 7039a24..d9fa192 100644 --- a/commands/search/searchAnime.js +++ b/commands/search/searchAnime.js @@ -27,7 +27,7 @@ class anime extends Command{ var fieldPayload = []; for(var i = 0; i<data.length; i++) { - fieldPayload.push({name:data[i].title.romaji+' ['+data[i].title.english+']', value:i.toString()}) + fieldPayload.push({name:data[i].title.romaji+' '+ (data[i].title.english?'['+data[i].title.english+']':''), value:i.toString()}) embeds.push(new EmbedBuilder().setImage(data[i].coverImage).setURL('https://www.rem.wordfights.com')); row.addComponents( new ButtonBuilder() @@ -58,11 +58,11 @@ class anime extends Command{ async function sendMessage(id) { const data = await new Anilist().getAnimeInfo(id); - // console.log('Command: SearchChar: SendMessage: Data', data.season) + // console.log('Command: SearchChar: SendMessage: Data', data) data.description = data.description.replaceAll('~!', '').replaceAll('!~', '').replaceAll(/<[^>]*>/g, ''); data.description = data.description.length>1500?(data.description.substring(0, 1500) + "..."):data.description; const embed = new EmbedBuilder() - .setTitle(`${data.title.romaji} (${data.title.native + data.title.english?'/'+data.title.english:''})`) + .setTitle(`${data.title.romaji} (${data.title.native + (data.title.english?'/'+data.title.english:'')})`) .setAuthor({name:"Rem-chan", iconURL:"https://i.imgur.com/g6FSNhL.png",url:'https://rem.wordfights.com/addtodiscord'}) .setColor(0x003284) .setDescription(data.description) diff --git a/commands/search/searchChar.js b/commands/search/searchChar.js index 88ccf66..dbc1382 100644 --- a/commands/search/searchChar.js +++ b/commands/search/searchChar.js @@ -61,6 +61,7 @@ class char extends Command{ const data = await new Anilist().getCharInfo(id); data.description = data.description.replaceAll('~!', '').replaceAll('!~', '').replaceAll(/<[^>]*>/g, ''); data.description = data.description.length>1500?(data.description.substring(0, 1500) + "..."):data.description; + console.log(data) const embed = new EmbedBuilder() .setTitle(`${data.name.full} (${data.name.native})`) .setAuthor({name:"Rem-chan", iconURL:"https://i.imgur.com/g6FSNhL.png",url:'https://rem.wordfights.com/addtodiscord'}) @@ -72,7 +73,12 @@ class char extends Command{ .setTimestamp() .addFields( {name:'Gender:', value:data.gender, inline:true}, - {name:'Page', value:data.url, inline:true}); + {name:'Page', value:data.url, inline:true} + ); + if(data.age) + { + embed.addFields({name:'Age:',value:data.age, inline:true}); + } const randomID = Random(); const row = new ActionRowBuilder() .addComponents( diff --git a/commands/search/searchManga.js b/commands/search/searchManga.js index 02bbd3b..8beea0e 100644 --- a/commands/search/searchManga.js +++ b/commands/search/searchManga.js @@ -65,7 +65,7 @@ class manga extends Command{ data.description = data.description.length>1500?(data.description.substring(0, 1500) + "..."):data.description; console.log(data.description) const embed = new EmbedBuilder() - .setTitle(`${data.title.romaji} (${data.title.native} / ${data.title.english})`) + .setTitle(`${data.title.romaji} (${data.title.native + (data.title.english?'/'+data.title.english:'')})`) .setAuthor({name:"Rem-chan", iconURL:"https://i.imgur.com/g6FSNhL.png",url:'https://rem.wordfights.com/addtodiscord'}) .setColor(0x003284) .setDescription(data.description) diff --git a/lib.js b/lib.js index 12948af..b8e73e7 100644 --- a/lib.js +++ b/lib.js @@ -812,6 +812,7 @@ class AnilistCli { native } gender + age siteUrl image { medium @@ -839,6 +840,7 @@ class AnilistCli { url:data.Character.siteUrl, image:data.Character.image.medium, description:data.Character.description, + age:data.Character.age, }