Skip to content

Commit

Permalink
Fix undefined "link" variable if exactly one attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkView authored Jun 15, 2021
1 parent d698bc1 commit 2ee1f7f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions embedMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ module.exports = async function ({ config, bot, formats }) {
url: threadMessage.attachments[0],
};
} else {
embed.description += `\n${link}`;
embed.description += `\n${threadMessage.attachments[0]}`;
}
} else {
for (const link of threadMessage.attachments) {
Expand Down Expand Up @@ -241,7 +241,7 @@ module.exports = async function ({ config, bot, formats }) {
url: threadMessage.attachments[0],
};
} else {
embed.description += `\n${link}`;
embed.description += `\n${threadMessage.attachments[0]}`;
}
} else {
for (const link of threadMessage.attachments) {
Expand Down Expand Up @@ -275,7 +275,7 @@ module.exports = async function ({ config, bot, formats }) {
url: threadMessage.attachments[0],
};
} else {
embed.description += `\n${link}`;
embed.description += `\n${threadMessage.attachments[0]}`;
}
} else {
for (const link of threadMessage.attachments) {
Expand Down Expand Up @@ -308,7 +308,7 @@ module.exports = async function ({ config, bot, formats }) {
url: threadMessage.attachments[0],
};
} else {
embed.description += `\n${link}`;
embed.description += `\n${threadMessage.attachments[0]}`;
}
} else {
for (const link of threadMessage.attachments) {
Expand Down Expand Up @@ -341,7 +341,7 @@ module.exports = async function ({ config, bot, formats }) {
url: threadMessage.attachments[0],
};
} else {
embed.description += `\n${link}`;
embed.description += `\n${threadMessage.attachments[0]}`;
}
} else {
for (const link of threadMessage.attachments) {
Expand Down Expand Up @@ -374,7 +374,7 @@ module.exports = async function ({ config, bot, formats }) {
url: threadMessage.attachments[0],
};
} else {
embed.description += `\n${link}`;
embed.description += `\n${threadMessage.attachments[0]}`;
}
} else {
for (const link of threadMessage.attachments) {
Expand Down

0 comments on commit 2ee1f7f

Please sign in to comment.