1
0
Fork 0

fixed shameboard

akairo
loicbersier 6 years ago
parent 97b312625e
commit 084e5cb21e

@ -11,7 +11,7 @@ class MessageReactionAddListener extends Listener {
}); });
} }
async exec(reaction, message, client) { async exec(reaction) {
let messageContent = reaction.message.content; let messageContent = reaction.message.content;
let messageAttachments = reaction.message.attachments.map(u=> `${u.url}`); let messageAttachments = reaction.message.attachments.map(u=> `${u.url}`);
@ -39,23 +39,18 @@ class MessageReactionAddListener extends Listener {
messageID.push(reaction.message.id); messageID.push(reaction.message.id);
let shameboardChannel = reload(`../starboard/${message.guild.id}.json`); let shameboardChannel = reload(`../starboard/${reaction.message.guild.id}.json`);
const channel = client.channels.get(shameboardChannel['shameboard']); const channel = this.client.channels.get(shameboardChannel['shameboard']);
const starEmbed = new MessageEmbed() const shameEmbed = new MessageEmbed()
.setColor() .setColor()
.setDescription(messageContent) .setDescription(messageContent)
.setAuthor(reaction.message.author.username, reaction.message.author.displayAvatarURL) .setAuthor(reaction.message.author.username, reaction.message.author.displayAvatarURL)
.setTimestamp(); .setTimestamp();
try { channel.send({ embed: shameEmbed});
channel.send({ embed: starEmbed}); return channel.send(`From: ${reaction.message.channel} ID: ${reaction.message.id} \n${messageAttachments}`);
await channel.send(messageAttachments);
} catch(err) {
console.error('There is no shameboard');
}
} }
} }
} }

Loading…
Cancel
Save