mirror of
https://github.com/reality/dbot.git
synced 2025-01-12 04:52:36 +01:00
redirects
This commit is contained in:
parent
b61c482a32
commit
5e8ccb6bcc
@ -30,6 +30,12 @@ var wikipedia = function(dbot) {
|
|||||||
return this.api.randomSentence(redirect[1], cb);
|
return this.api.randomSentence(redirect[1], cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var refer = body.match(/may refer to:/i);
|
||||||
|
if(refer) {
|
||||||
|
var links = body.match(/\[\[(.+)\]\]/g);
|
||||||
|
return this.api.randomSentence(links[_.random(0,links.length-1)], cb);
|
||||||
|
}
|
||||||
|
|
||||||
body = body.replace(/=(.+)=/g,'');
|
body = body.replace(/=(.+)=/g,'');
|
||||||
body = body.replace(/\t/g,'');
|
body = body.replace(/\t/g,'');
|
||||||
body = body.replace(/\{(.+)\}/g,'');
|
body = body.replace(/\{(.+)\}/g,'');
|
||||||
|
Loading…
Reference in New Issue
Block a user