Fixed detection of links in all channels
This commit is contained in:
parent
6cab2ebab8
commit
218d2ec40f
13
feed-bot.js
13
feed-bot.js
|
@ -49,14 +49,15 @@ 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
|
||||||
Uri.withinString(message, function (url) {
|
Uri.withinString(message, function (url) {
|
||||||
Links.cache(Links.standardise(url));
|
Links.cache(Links.standardise(url));
|
||||||
return url;
|
return url;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
checkPastMessagesForLinks: function () {
|
checkPastMessagesForLinks: function () {
|
||||||
var limit = 100;
|
var limit = 100;
|
||||||
|
|
Loading…
Reference in a new issue