Compare commits

..

No commits in common. "e9260346441a7463b152d3a642f534e6e3d53eaa" and "5cb52fb3714c16b6c612d8ad7efa79873bf81344" have entirely different histories.

3 changed files with 21 additions and 20 deletions

View file

@ -227,7 +227,7 @@ export default {
const Embed = new EmbedBuilder() const Embed = new EmbedBuilder()
.setAuthor({ name: quote.author.username, iconURL: quote.author.displayAvatarURL() }) .setAuthor({ name: quote.author.username, iconURL: quote.author.displayAvatarURL() })
.setColor(message.member ? message.member.displayHexColor : 'Navy') .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.addFields( .addFields(
{ name: 'Jump to', value: `[message](https://discordapp.com/channels/${message.guild.id}/${channelID}/${messageID})`, inline: true }, { name: 'Jump to', value: `[message](https://discordapp.com/channels/${message.guild.id}/${channelID}/${messageID})`, inline: true },
{ name: 'In channel', value: quote.channel.name.toString(), inline: true }, { name: 'In channel', value: quote.channel.name.toString(), inline: true },

View file

@ -45,10 +45,10 @@ export default {
if (reaction.emoji == staremote || reaction.emoji.name == staremote) { if (reaction.emoji == staremote || reaction.emoji.name == staremote) {
if (global.boards[reaction.message.id] && reactionCount > starcount) { if (global.boards[reaction.message.id] && reactionCount > starcount) {
return editEmbed('starboard', staremote, global.boards[reaction.message.id]); return editEmbed('starboard', staremote, global.boards[reaction.message.id], c);
} }
else if (reactionCount == starcount) { else if (reactionCount == starcount) {
return sendEmbed('starboard', staremote); return sendEmbed('starboard', staremote, c);
} }
} }
} }
@ -65,24 +65,25 @@ export default {
if (reaction.emoji == shameemote || reaction.emoji.name == shameemote) { if (reaction.emoji == shameemote || reaction.emoji.name == shameemote) {
if (global.boards[reaction.message.id] && reactionCount > shamecount) { if (global.boards[reaction.message.id] && reactionCount > shamecount) {
return editEmbed('shameboard', shameemote, global.boards[reaction.message.id]); return editEmbed('shameboard', shameemote, global.boards[reaction.message.id], c);
} }
else if (reactionCount == shamecount) { else if (reactionCount == shamecount) {
return sendEmbed('shameboard', shameemote); return sendEmbed('shameboard', shameemote, c);
} }
} }
} }
async function editEmbed(name, emote, boardID) { async function editEmbed(name, emote, boardID, client) {
let channel; let channel;
if (name == 'starboard') { if (name == 'starboard') {
channel = c.channels.resolve(starboardChannel.starboard); channel = client.channels.resolve(starboardChannel.starboard);
} }
else { else {
channel = c.channels.resolve(shameboardChannel.shameboard); channel = client.channels.resolve(shameboardChannel.shameboard);
} }
const message = await channel.messages.resolve(boardID); const message = await channel.messages.resolve(boardID);
// If the message doesn't have embeds assume it got deleted so don't do anything // If the message doesn't have embeds assume it got deleted so don't do anything
if (!message) return; if (!message) return;
@ -93,7 +94,7 @@ export default {
} }
const Embed = new EmbedBuilder() const Embed = new EmbedBuilder()
.setColor(reaction.message.member ? reaction.message.member.displayHexColor : 'Navy') .setColor(reaction.message.member ? reaction.message.member.displayHexColor : 'NAVY')
.setAuthor({ name: reaction.message.author.username, iconURL: reaction.message.author.displayAvatarURL() }) .setAuthor({ name: reaction.message.author.username, iconURL: reaction.message.author.displayAvatarURL() })
.addFields( .addFields(
{ name: 'Jump to', value: `[message](https://discordapp.com/channels/${reaction.message.guild.id}/${reaction.message.channel.id}/${reaction.message.id})`, inline: true }, { name: 'Jump to', value: `[message](https://discordapp.com/channels/${reaction.message.guild.id}/${reaction.message.channel.id}/${reaction.message.id})`, inline: true },
@ -105,18 +106,18 @@ export default {
if (reaction.message.guild.emojis.resolve(emote)) Embed.setFooter(reactionCount, reaction.message.guild.emojis.resolve(emote).url); if (reaction.message.guild.emojis.resolve(emote)) Embed.setFooter(reactionCount, reaction.message.guild.emojis.resolve(emote).url);
message.edit({ embeds: [Embed] }); message.edit({ embed: Embed });
} }
async function sendEmbed(name, emote) { async function sendEmbed(name, emote, client) {
let messageAttachments = reaction.message.attachments.map(u => u.url)[0]; let messageAttachments = reaction.message.attachments.map(u => u.url)[0];
// Should change this so it automatically pick the channel ( I'm lazy right now ) // Should change this so it automatically pic the channel ( I'm lazy right now )
let channel; let channel;
if (name == 'starboard') { if (name == 'starboard') {
channel = c.channels.resolve(starboardChannel.starboard); channel = client.channels.resolve(starboardChannel.starboard);
} }
else { else {
channel = c.channels.resolve(shameboardChannel.shameboard); channel = client.channels.resolve(shameboardChannel.shameboard);
} }
const Embed = new EmbedBuilder() const Embed = new EmbedBuilder()

View file

@ -53,7 +53,7 @@ export default {
message.delete(); message.delete();
} }
else if ((reaction.emoji == staremote || reaction.emoji.name == staremote) && reactionCount >= starcount) { else if ((reaction.emoji == staremote || reaction.emoji.name == staremote) && reactionCount >= starcount) {
return editEmbed('starboard', staremote, global.boards[reaction.message.id]); return editEmbed('starboard', staremote, global.boards[reaction.message.id], this.client);
} }
} }
@ -77,17 +77,17 @@ export default {
message.delete(); message.delete();
} }
else if ((reaction.emoji == shameemote || reaction.emoji.name == shameemote) && reactionCount >= shamecount) { else if ((reaction.emoji == shameemote || reaction.emoji.name == shameemote) && reactionCount >= shamecount) {
return editEmbed('shameboard', shameemote, global.boards[reaction.message.id]); return editEmbed('shameboard', shameemote, global.boards[reaction.message.id], this.client);
} }
} }
async function editEmbed(name, emote, boardID) { async function editEmbed(name, emote, boardID, client) {
let channel; let channel;
if (name == 'starboard') { if (name == 'starboard') {
channel = c.channels.resolve(starboardChannel.starboard); channel = client.channels.resolve(starboardChannel.starboard);
} }
else { else {
channel = c.channels.resolve(shameboardChannel.shameboard); channel = client.channels.resolve(shameboardChannel.shameboard);
} }
const message = await channel.messages.resolve(boardID); const message = await channel.messages.resolve(boardID);
@ -114,7 +114,7 @@ export default {
if (reaction.message.guild.emojis.resolve(emote)) Embed.setFooter(reactionCount, reaction.message.guild.emojis.resolve(emote).url); if (reaction.message.guild.emojis.resolve(emote)) Embed.setFooter(reactionCount, reaction.message.guild.emojis.resolve(emote).url);
message.edit({ embeds: [Embed] }); message.edit({ embed: Embed });
} }
}, },
}; };