|
|
|
@ -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)
|
|
|
|
|