so basically im trying to make custom command that will get the youtube vid id and trigger urlfetch and include the id into the url
this is the code
somehow the $(query) result will give as $(query), not the value given by chat
$(eval
const api = $(urlfetch
json https://6f1c-60-50-144-78.ngrok.io/api/drum-request/$(userid)/$(user)/$(eval
regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?( (#&?)*).*/;
url = "$(query)";
match = url.match(regExp);
$id = (match&&match[7].length==11)? match[7] : false;
$id
)
);
api[0]
)
if i were to try getting the youtube vid id on its own, it would works as normal
$(eval
regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?( (#&?)*).*/;
url = "$(query)";
match = url.match(regExp);
$id = (match&&match[7].length==11)? match[7] : false;
$id
)