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 messageContent = reaction.message.content;
|
||||||
let messageAttachments = reaction.message.attachments.map(u=> `${u.url}`);
|
let messageAttachments = reaction.message.attachments.map(u=> `${u.url}`);
|
||||||
|
|
||||||
|
@ -39,24 +39,19 @@ 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');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = MessageReactionAddListener;
|
module.exports = MessageReactionAddListener;
|
Loading…
Reference in a new issue