diff --git a/bot.js b/bot.js index 4d8dd6b..65070e8 100755 --- a/bot.js +++ b/bot.js @@ -85,7 +85,7 @@ client.on( Events.MessageCreate, async message => { if (message.content.startsWith('!play') && message.member.voice.channel) { console.log(`!play issued by ${message.author.tag} ${message.author.id}`); // Determine if we have a URL or a search term - const ytmatch = message.content.match(/(?<=(https?:\/\/)(www\.)?youtu((be\.com\/(watch\?v=)|(shorts\/))|(\.be\/)))[\w-]{11,12}/); + const ytmatch = message.content.match(/(?<=(?:https?:\/\/)(?:www\.)?youtu(?:(?:be\.com\/(?:(?:watch\?v=)|(?:shorts\/)))|(?:\.be\/)))[\w-]{11,12}/); var yturl = null; var timestamp = '0' if (ytmatch) {