From b302bdc4c466717e667e2604c5fc1ff58e4e50fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bersier?= Date: Sat, 30 Mar 2019 15:19:29 +0100 Subject: [PATCH] Added embed --- commands/general/tweet.js | 10 ++++++++-- commands/utility/feedback.js | 11 ++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/commands/general/tweet.js b/commands/general/tweet.js index 86d35981..a4abca32 100644 --- a/commands/general/tweet.js +++ b/commands/general/tweet.js @@ -2,6 +2,7 @@ const { Command } = require('discord-akairo'); const Twitter = require('twitter-lite'); const rand = require('../../rand.js'); const Filter = require('bad-words'); +const { MessageEmbed } = require('discord.js'); let filter = new Filter(); const { twiConsumer, twiConsumerSecret, twiToken, twiTokenSecret, twiChannel } = require('../../config.json'); const reload = require('auto-reload'); @@ -64,9 +65,14 @@ class tweetCommand extends Command { const tweetid = response.id_str; - // Send the final text + const Embed = new MessageEmbed() + .setAuthor(message.author.username, message.author.displayAvatarURL()) + .setDescription(args.text) + .addField('Link', `https://twitter.com/HahaYesDB/status/${tweetid}`) + .setFooter(`Tweet ID: ${tweetid} | Author ID: ${message.author.id}`) + .setTimestamp(); - channel.send(`AUTHOR: ${message.author.username} (${message.author.id}) Sent: ${args.text}\nhttps://twitter.com/HahaYesDB/status/${tweetid}`); + channel.send({embed: Embed}); return message.channel.send(`Go see ur epic tweet https://twitter.com/HahaYesDB/status/${tweetid}`); } catch(err) { diff --git a/commands/utility/feedback.js b/commands/utility/feedback.js index 2f934309..1967df40 100644 --- a/commands/utility/feedback.js +++ b/commands/utility/feedback.js @@ -1,5 +1,6 @@ const { Command } = require('discord-akairo'); const { feedbackChannel } = require('../../config.json'); +const { MessageEmbed } = require('discord.js'); class FeedbackCommand extends Command { constructor() { @@ -23,10 +24,14 @@ class FeedbackCommand extends Command { } async exec(message,args) { - let text = args.text; - const channel = this.client.channels.get(feedbackChannel); - channel.send(`from ${message.author.username} (${message.author.id}) : ${text}`); + + const Embed = new MessageEmbed() + .setAuthor(message.author.username, message.author.displayAvatarURL()) + .setDescription(args.text) + .setFooter(`Author ID: ${message.author.id}`) + .setTimestamp(); + channel.send({embed: Embed}); message.channel.send('Your feedback has been sent!'); } }