Adding Embeds for Text

This commit is contained in:
= 2021-07-13 21:13:46 -04:00
parent 259b0578d8
commit 304b4c1205
4 changed files with 13 additions and 4 deletions

View File

@ -10,6 +10,6 @@ module.exports = {
} else {
replyBody = client.pastas.get(file.name).content;
}
message.channel.send(replyHeader + replyBody);
message.channel.send(functions.createTextEmbed({ content: replyBody }, message.author, `${file.name}.${file.extension}`));
}
}

View File

@ -1,9 +1,10 @@
const functions = require('../functions.js');
module.exports = {
name: 'spongebob',
description: 'SpOnGeBoB-iFy AnYtHiNg AuToMaTiCaLly',
usage: '<text you want spongebob-ified',
execute(message, file) {
const replyHeader = `Requested by: ${message.author.username}\n`;
let flipper = 0;
let newText = '';
for (const letter of file.name) {
@ -15,6 +16,6 @@ module.exports = {
flipper = 0;
}
}
message.channel.send(replyHeader + newText);
message.channel.send(functions.createTextEmbed({ content: newText }, message.author, `${file.name}.${file.extension}`));
}
}

View File

@ -90,5 +90,12 @@ module.exports = {
.setThumbnail(`https:${weather.condition.icon}`)
.setTimestamp()
.setFooter(`@${author.username}#${author.discriminator}`);
},
createTextEmbed(data, author, command) {
return new Discord.MessageEmbed()
.setAuthor(command)
.setDescription(data.content)
.setTimestamp()
.setFooter(`@${author.username}#${author.discriminator}`);
}
}

View File

@ -26,6 +26,7 @@ client.once('ready', () => {
// .catch(err => console.error(err));
// })
// .catch(err => console.error(err));
client.users.fetch(process.env.ownerID)
});
client.login(process.env.TOKEN)