Added embed

This commit is contained in:
Loïc Bersier 2019-03-30 15:19:29 +01:00
parent e28ba5d056
commit b302bdc4c4
2 changed files with 16 additions and 5 deletions

View file

@ -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) {

View file

@ -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!');
}
}