Browse Source

Fix issue posting link if role is null

shorten
benji7425 4 years ago
parent
commit
f96b1a3585
  1. 4
      app/models/feed-data.js

4
app/models/feed-data.js

@ -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);
}
}
});

Loading…
Cancel
Save