forked from Supositware/Haha-Yes
Check if the message is in starboard before attempting to delete it
This commit is contained in:
parent
331de1784f
commit
3d0448b588
1 changed files with 2 additions and 2 deletions
|
@ -25,7 +25,7 @@ class messageReactionRemoveListener extends Listener {
|
||||||
staremote = this.client.util.resolveEmoji(staremote, reaction.message.guild.emojis).name;
|
staremote = this.client.util.resolveEmoji(staremote, reaction.message.guild.emojis).name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reaction.emoji.name == staremote && reaction.count < starcount) {
|
if (messageID[reaction.message.id] && reaction.emoji.name == staremote && reaction.count < starcount) {
|
||||||
let channel = this.client.channels.get(starboardChannel.starboard);
|
let channel = this.client.channels.get(starboardChannel.starboard);
|
||||||
let message = await channel.messages.get(messageID[reaction.message.id]);
|
let message = await channel.messages.get(messageID[reaction.message.id]);
|
||||||
message.delete();
|
message.delete();
|
||||||
|
@ -45,7 +45,7 @@ class messageReactionRemoveListener extends Listener {
|
||||||
shameemote = this.client.util.resolveEmoji(shameemote, reaction.message.guild.emojis).name;
|
shameemote = this.client.util.resolveEmoji(shameemote, reaction.message.guild.emojis).name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reaction.emoji.name == shameemote && reaction.count < shamecount) {
|
if (messageID[reaction.message.id] && reaction.emoji.name == shameemote && reaction.count < shamecount) {
|
||||||
let channel = this.client.channels.get(shameboardChannel.shameboard);
|
let channel = this.client.channels.get(shameboardChannel.shameboard);
|
||||||
let message = await channel.messages.get(messageID[reaction.message.id]);
|
let message = await channel.messages.get(messageID[reaction.message.id]);
|
||||||
message.delete();
|
message.delete();
|
||||||
|
|
Loading…
Reference in a new issue