Added tagging of subscribed users when link posted

This commit is contained in:
benji7425 2017-01-08 07:52:34 +00:00
parent 8cdca1f616
commit 650a891cbb

View file

@ -106,10 +106,14 @@ var DiscordClient = {
}); });
}, },
post: function (link) { post: function (link) {
var tags = "";
for (var userID in Subscriptions.subscribers)
tags += "<@" + Subscriptions.subscribers[userID] + "> ";
//send a messsage containing the new feed link to our discord channel //send a messsage containing the new feed link to our discord channel
DiscordClient.bot.sendMessage({ DiscordClient.bot.sendMessage({
to: Config.channelID, to: Config.channelID,
message: link message: tags + link
}, function (err, message) { }, function (err, message) {
if (err) { if (err) {
Log.error("ERROR: Failed to send message: " + message.substring(0, 15) + "...", err); Log.error("ERROR: Failed to send message: " + message.substring(0, 15) + "...", err);