add link on url title

This commit is contained in:
mose 2019-09-14 10:14:20 +08:00
parent 24c77103a9
commit 7d01477469

View file

@ -8,7 +8,7 @@ bot.global.text(/(https?:\/\/.*)[, $]?/i, (b) => {
var re = /<title>([^<]*)<\/title>/gi;
var match = re.exec(body);
if (match && match[1]) {
b.respond(":link: _" + match[1] + "_");
b.respond("[:link:](" + b.match[1] + ") _" + match[1] + "_");
}
}
});