Fix issue posting link if role is null

This commit is contained in:
benji7425 2017-08-23 01:15:11 +01:00
parent ab300263ab
commit f96b1a3585
1 changed files with 2 additions and 2 deletions

View File

@ -57,8 +57,8 @@ module.exports = class FeedData {
this.cachedLinks.push(latest);
const channel = guild.channels.find(ch => ch.type === "text" && ch.name.toLowerCase() === this.channelName.toLowerCase());
const role = guild.roles.find(role => role.name.toLowerCase() === this.roleName.toLowerCase());
channel.send(role + " " + latest);
const role = this.roleName ? guild.roles.find(role => role.name.toLowerCase() === this.roleName.toLowerCase()) : null;
channel.send(role ? role + " " : "" + latest);
}
}
});