Added embed

merge-requests/3/head
Loïc Bersier 5 years ago
parent e28ba5d056
commit b302bdc4c4

@ -2,6 +2,7 @@ const { Command } = require('discord-akairo');
const Twitter = require('twitter-lite'); const Twitter = require('twitter-lite');
const rand = require('../../rand.js'); const rand = require('../../rand.js');
const Filter = require('bad-words'); const Filter = require('bad-words');
const { MessageEmbed } = require('discord.js');
let filter = new Filter(); let filter = new Filter();
const { twiConsumer, twiConsumerSecret, twiToken, twiTokenSecret, twiChannel } = require('../../config.json'); const { twiConsumer, twiConsumerSecret, twiToken, twiTokenSecret, twiChannel } = require('../../config.json');
const reload = require('auto-reload'); const reload = require('auto-reload');
@ -64,9 +65,14 @@ class tweetCommand extends Command {
const tweetid = response.id_str; 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}`); return message.channel.send(`Go see ur epic tweet https://twitter.com/HahaYesDB/status/${tweetid}`);
} catch(err) { } catch(err) {

@ -1,5 +1,6 @@
const { Command } = require('discord-akairo'); const { Command } = require('discord-akairo');
const { feedbackChannel } = require('../../config.json'); const { feedbackChannel } = require('../../config.json');
const { MessageEmbed } = require('discord.js');
class FeedbackCommand extends Command { class FeedbackCommand extends Command {
constructor() { constructor() {
@ -23,10 +24,14 @@ class FeedbackCommand extends Command {
} }
async exec(message,args) { async exec(message,args) {
let text = args.text;
const channel = this.client.channels.get(feedbackChannel); 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!'); message.channel.send('Your feedback has been sent!');
} }
} }

Loading…
Cancel
Save