mirror of
https://github.com/reality/dbot.git
synced 2024-11-27 14:29:29 +01:00
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() {
|
||||
var srHandler = function(event, matches, name) {
|
||||
this.api.getSubredditInfo(matches[1], function(info) {
|
||||
this.api.getSubredditInfo(matches[2], function(info) {
|
||||
if(info.data) {
|
||||
info = info.data;
|
||||
var infoString = dbot.t('about_subreddit', {
|
||||
@ -37,7 +37,7 @@ var reddit = function(dbot) {
|
||||
}
|
||||
});
|
||||
}.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);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user