mirror of
https://github.com/reality/dbot.git
synced 2024-11-24 04:49:25 +01:00
Only auto shorten long links
This commit is contained in:
parent
d0ed2eddd1
commit
19a3d9cf87
@ -8,7 +8,7 @@ var autoshorten = function(dbot) {
|
|||||||
var urlRegex = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
|
var urlRegex = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
|
||||||
var urlMatches = data.message.match(urlRegex);
|
var urlMatches = data.message.match(urlRegex);
|
||||||
|
|
||||||
if(urlMatches !== null) {
|
if(urlMatches !== null && urlMatches[0].length > 45) {
|
||||||
var url = urlMatches[0]; // Only doing one, screw you.
|
var url = urlMatches[0]; // Only doing one, screw you.
|
||||||
|
|
||||||
var options = {
|
var options = {
|
||||||
|
Loading…
Reference in New Issue
Block a user