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)
{
const data = await new aniList().getCharInfo(id);
console.log('Command: SearchChar: SendMessage: Data', 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'})
.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' })
.setImage(data.image)
.setThumbnail(data.image)
.setTimestamp()
.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 row = new ActionRowBuilder()
.addComponents(

@ -65,7 +65,7 @@ class manga extends Command{
.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'})
.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' })
.setImage(data.coverImage)
.setThumbnail(data.coverImage)

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

Loading…
Cancel
Save