fixed shameboard
This commit is contained in:
parent
97b312625e
commit
084e5cb21e
1 changed files with 7 additions and 12 deletions
|
@ -11,7 +11,7 @@ class MessageReactionAddListener extends Listener {
|
|||
});
|
||||
}
|
||||
|
||||
async exec(reaction, message, client) {
|
||||
async exec(reaction) {
|
||||
let messageContent = reaction.message.content;
|
||||
let messageAttachments = reaction.message.attachments.map(u=> `${u.url}`);
|
||||
|
||||
|
@ -39,23 +39,18 @@ class MessageReactionAddListener extends Listener {
|
|||
|
||||
messageID.push(reaction.message.id);
|
||||
|
||||
let shameboardChannel = reload(`../starboard/${message.guild.id}.json`);
|
||||
const channel = client.channels.get(shameboardChannel['shameboard']);
|
||||
let shameboardChannel = reload(`../starboard/${reaction.message.guild.id}.json`);
|
||||
const channel = this.client.channels.get(shameboardChannel['shameboard']);
|
||||
|
||||
const starEmbed = new MessageEmbed()
|
||||
const shameEmbed = new MessageEmbed()
|
||||
.setColor()
|
||||
.setDescription(messageContent)
|
||||
.setAuthor(reaction.message.author.username, reaction.message.author.displayAvatarURL)
|
||||
.setTimestamp();
|
||||
|
||||
try {
|
||||
channel.send({ embed: starEmbed});
|
||||
await channel.send(messageAttachments);
|
||||
} catch(err) {
|
||||
console.error('There is no shameboard');
|
||||
}
|
||||
channel.send({ embed: shameEmbed});
|
||||
return channel.send(`From: ${reaction.message.channel} ID: ${reaction.message.id} \n${messageAttachments}`);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue