Merge branch 'fbclid_in_coabot_link' into 'master'

Coabot don't send fbclid info

See merge request crapaud-fou/coabot!1
This commit is contained in:
mose 2019-11-10 16:45:00 +00:00
commit f1803f5cca

View file

@ -23,6 +23,7 @@ bot.global.text(/(https?:\/\/[^ ,\)"\n]*)/ig, async (b) => {
if (match && match[1]) { if (match && match[1]) {
var extra = ""; var extra = "";
var link = res.request.uri.href; var link = res.request.uri.href;
link = link.replace(/[\?&]fbclid=.+/gi, "");
if (/youtube.com/.test(link)) { if (/youtube.com/.test(link)) {
if (t = /[?&]v=([^&]+)/.exec(link)) { if (t = /[?&]v=([^&]+)/.exec(link)) {
link = "https://www.youtube.com/watch?v=" + t[1]; link = "https://www.youtube.com/watch?v=" + t[1];