forked from GitHub/dbot
fix for reddit data with www
This commit is contained in:
parent
a881e60c81
commit
234e84010c
@ -24,7 +24,7 @@ var reddit = function(dbot) {
|
|||||||
|
|
||||||
this.onLoad = function() {
|
this.onLoad = function() {
|
||||||
var srHandler = function(event, matches, name) {
|
var srHandler = function(event, matches, name) {
|
||||||
this.api.getSubredditInfo(matches[1], function(info) {
|
this.api.getSubredditInfo(matches[2], function(info) {
|
||||||
if(info.data) {
|
if(info.data) {
|
||||||
info = info.data;
|
info = info.data;
|
||||||
var infoString = dbot.t('about_subreddit', {
|
var infoString = dbot.t('about_subreddit', {
|
||||||
@ -37,7 +37,7 @@ var reddit = function(dbot) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
dbot.api.link.addHandler(this.name, /https?:\/\/reddit\.com\/r\/([a-zA-Z0-9]+)/, srHandler);
|
dbot.api.link.addHandler(this.name, /https?:\/\/(www\.)?reddit\.com\/r\/([a-zA-Z0-9]+)/, srHandler);
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user