INNER CODE UNIT · JavaScript
vid
SethClydesdale/cunny-code · resources/javascript/arona.js:1020
var vid = value.match(/.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|live\/|watch\?v=)([^#\&\?]*).*/i);
if (vid && vid[1]) {
// clean video id of any trailing whitespace/words & sanitize
vid = (/\s/.test(vid[1]) ? vid[1].split(/\s/)[0] : vid[1]).replace(/</g, '');
// replace the {ID} placeholder with the actual ID
Arona.say(Arona.speech.special.youtube[0].replace('{ID}', vid), Arona.speech.special.youtube[1], Infinity);
Arona.idlingStop = true; // prevent video interruption from idle messages
}
}
// shows help prompt if sensei asks arona for help
else if (/arona(?:, | )help(?: me|)|help(?: me|)(?:, | )arona/i.test(value)) {
Arona.help();
}
// Arona returns if you say sorry after making her mad