Search chosen item description

master
masterhc 1 year ago
parent a797906107
commit 4cf4305a69

@ -62,7 +62,7 @@ class anime 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>','').replaceAll('<i>','').replaceAll('</i>', ''))
.setDescription(data.description.replaceAll('~! ', '').replaceAll('<br>', ' ').substring(0, 1500) + "...")
.setFooter({ text: 'Rem-Chan on', iconURL: 'https://i.imgur.com/g6FSNhL.png' })
.setImage(data.coverImage)
.setThumbnail(data.coverImage)

@ -59,12 +59,12 @@ class char extends Command{
async function sendMessage(id)
{
const data = await new aniList().getCharInfo(id);
console.log('Command: SearchChar: SendMessage: Data', data)
console.log('Command: SearchChar: SendMessage: Data', typeof data.description)
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.replaceAll('~! ', '').replaceAll('<br>', ' ').substring(0, 1500) + "...")
.setFooter({ text: 'Rem-Chan on', iconURL: 'https://i.imgur.com/g6FSNhL.png' })
.setImage(data.image)
.setThumbnail(data.image)

@ -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('~! ', '').replaceAll('<br>', ' ').substring(0, 1500) + "...")
.setFooter({ text: 'Rem-Chan on', iconURL: 'https://i.imgur.com/g6FSNhL.png' })
.addFields({name:'Page', value:data.url, inline:true})
.setImage(data.coverImage)

@ -187,7 +187,7 @@ class _Client extends Client
this.on("messageCreate", message=>
{
this.checkForInvites(message);
if(message.content.startsWith('!'))
if(message.content.startsWith(process.env.prefix)) //Test prefix t!
{
let commandName=message.content.split('!')[1].split(' ')[0];
let args = message.content.split(' ');
@ -312,7 +312,7 @@ class _Client extends Client
{
return error;
});
// console.log('Lib: YTFeed:',ytChannelName, res.author.name, channel.name,feed.ChannelId ,channel.id)
console.log('Lib: YTFeed:',ytChannelName, res?.author?.name, channel.name,feed?.ChannelId ,channel.id)
var aux = res;
const lastSentMessage= await channel.messages.fetch().then(res=>
{
@ -346,13 +346,13 @@ class _Client extends Client
embed.setAuthor({name:"Rem-chan", iconURL:"https://i.imgur.com/g6FSNhL.png",url:'https://rem.wordfights.com/addtodiscord'});
embed.setColor(0x110809);
embed.setTimestamp();
embed.setURL(res.author.url)
embed.setTitle(res.author.name);
embed.setImage(`https://i3.ytimg.com/vi/${res.image}/maxresdefault.jpg`)
embed.setDescription(feed.CostumMessage);
embed.addFields({name:res.title, value:' '},
{name:'PublishedTimeStamp', value:res.published},
{name:'Link:', value:res.link});
embed.setURL(res?.author?.url)
embed.setTitle(res?.author?.name);
embed.setImage(`https://i3.ytimg.com/vi/${res?.image}/maxresdefault.jpg`)
embed.setDescription(feed?.CostumMessage);
embed.addFields({name:res?.title, value:' '},
{name:'PublishedTimeStamp', value:res?.published},
{name:'Link:', value:res?.link});
channel.send({embeds:[embed]});
}
}

Loading…
Cancel
Save