Fix issue posting link if role is null
This commit is contained in:
parent
ab300263ab
commit
f96b1a3585
|
@ -57,8 +57,8 @@ module.exports = class FeedData {
|
||||||
this.cachedLinks.push(latest);
|
this.cachedLinks.push(latest);
|
||||||
|
|
||||||
const channel = guild.channels.find(ch => ch.type === "text" && ch.name.toLowerCase() === this.channelName.toLowerCase());
|
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());
|
const role = this.roleName ? guild.roles.find(role => role.name.toLowerCase() === this.roleName.toLowerCase()) : null;
|
||||||
channel.send(role + " " + latest);
|
channel.send(role ? role + " " : "" + latest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue