Limit descriptions to a size that wont breake everything + char url

master
masterhc 1 year ago
parent fd78e25f04
commit 2170356778

@ -59,17 +59,19 @@ class char extends Command{
async function sendMessage(id) async function sendMessage(id)
{ {
const data = await new aniList().getCharInfo(id); const data = await new aniList().getCharInfo(id);
console.log('Command: SearchChar: SendMessage: Data', data)
const embed = new EmbedBuilder() const embed = new EmbedBuilder()
.setTitle(`${data.name.full} (${data.name.native})`) .setTitle(`${data.name.full} (${data.name.native})`)
.setAuthor({name:"Rem-chan", iconURL:"https://i.imgur.com/g6FSNhL.png",url:'https://rem.wordfights.com/addtodiscord'}) .setAuthor({name:"Rem-chan", iconURL:"https://i.imgur.com/g6FSNhL.png",url:'https://rem.wordfights.com/addtodiscord'})
.setColor(0x003284) .setColor(0x003284)
.setDescription(data.description)//.split('~! ')[1].replaceAll('<br>', ' ').substring(0, 1500) + "...") .setDescription(data.description.split('~! ')[1].replaceAll('<br>', ' ').substring(0, 1500) + "...")
.setFooter({ text: 'Rem-Chan on', iconURL: 'https://i.imgur.com/g6FSNhL.png' }) .setFooter({ text: 'Rem-Chan on', iconURL: 'https://i.imgur.com/g6FSNhL.png' })
.setImage(data.image) .setImage(data.image)
.setThumbnail(data.image) .setThumbnail(data.image)
.setTimestamp() .setTimestamp()
.addFields( .addFields(
{name:'Gender:', value:data.gender, inline:true}); {name:'Gender:', value:data.gender, inline:true},
{name:'Page', value:data.url, inline:true});
const randomID = Random(); const randomID = Random();
const row = new ActionRowBuilder() const row = new ActionRowBuilder()
.addComponents( .addComponents(

@ -65,7 +65,7 @@ class manga extends Command{
.setTitle(`${data.title.romaji} (${data.title.native} / ${data.title.english})`) .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'}) .setAuthor({name:"Rem-chan", iconURL:"https://i.imgur.com/g6FSNhL.png",url:'https://rem.wordfights.com/addtodiscord'})
.setColor(0x003284) .setColor(0x003284)
.setDescription(data.description)//.replaceAll('<br>', ' ').substring(0, 1500) + "...") .setDescription(data.description.replaceAll('<br>', ' ').substring(0, 1500) + "...")
.setFooter({ text: 'Rem-Chan on', iconURL: 'https://i.imgur.com/g6FSNhL.png' }) .setFooter({ text: 'Rem-Chan on', iconURL: 'https://i.imgur.com/g6FSNhL.png' })
.setImage(data.coverImage) .setImage(data.coverImage)
.setThumbnail(data.coverImage) .setThumbnail(data.coverImage)

@ -184,7 +184,6 @@ class _Client extends Client
*/ */
async enableCommands() async enableCommands()
{ {
//use needs admin here!!!!
this.on("messageCreate", message=> this.on("messageCreate", message=>
{ {
this.checkForInvites(message); this.checkForInvites(message);
@ -739,6 +738,7 @@ class aniListCli {
full full
native native
} }
siteUrl
gender gender
image { image {
medium medium
@ -782,6 +782,7 @@ class aniListCli {
id:char.id, id:char.id,
name:char.name, name:char.name,
gender:char.gender, gender:char.gender,
url:char.siteUrl,
image:char.image.medium image:char.image.medium
}) })
} }
@ -803,6 +804,7 @@ class aniListCli {
native native
} }
gender gender
siteUrl
image { image {
medium medium
} }
@ -839,6 +841,7 @@ class aniListCli {
return { return {
name:data.data.Character.name, name:data.data.Character.name,
gender:data.data.Character.gender, gender:data.data.Character.gender,
url:data.data.Character.siteUrl,
image:data.data.Character.image.medium, image:data.data.Character.image.medium,
description:data.data.Character.description, description:data.data.Character.description,
} }

Loading…
Cancel
Save