Fixed brackets

This commit is contained in:
benji7425 2017-01-08 05:27:49 +00:00
parent 85f10dc99a
commit 76819d658a

View file

@ -49,7 +49,7 @@ var DiscordClient = {
}, },
onMessage: function (user, userID, channelID, message) { onMessage: function (user, userID, channelID, message) {
//check if the message is in the right channel, contains a link, and is not the latest link from the rss feed //check if the message is in the right channel, contains a link, and is not the latest link from the rss feed
if (channelID === Config.channelID && Links.messageContainsLink(message) && (message !== Links.latestFromFeedlatestFeedLink if (channelID === Config.channelID && Links.messageContainsLink(message) && (message !== Links.latestFromFeedlatestFeedLink))
Log.event("Detected posted link in this message: " + message, "Discord.io"); Log.event("Detected posted link in this message: " + message, "Discord.io");
//extract the url from the string, and cache it //extract the url from the string, and cache it
@ -57,8 +57,7 @@ var DiscordClient = {
Links.cache(Links.standardise(url)); Links.cache(Links.standardise(url));
return url; return url;
}); });
} },
},
checkPastMessagesForLinks: function () { checkPastMessagesForLinks: function () {
var limit = 100; var limit = 100;
Log.info("Attempting to check past " + limit + " messages for links"); Log.info("Attempting to check past " + limit + " messages for links");
@ -148,7 +147,7 @@ var Links = {
Log.info("Cached URL: " + link); Log.info("Cached URL: " + link);
} }
if (Links.cached.length > (Config.numLinksToCache || 10)) Links.cached.shift(); //get rid of the first array element if we have reached our cache limit if (Links.cached.length > Config.numLinksToCache) Links.cached.shift(); //get rid of the first array element if we have reached our cache limit
}, },
isCached: function (link) { isCached: function (link) {
link = Links.standardise(link); link = Links.standardise(link);