Added new weird youtube.com URL

This commit is contained in:
Logan G 2023-11-15 19:22:27 -07:00
parent 58ff7e8edf
commit a526c21484
Signed by: logan
GPG key ID: E328528C921E7A7A

View file

@ -89,10 +89,10 @@ func messageCreate(session *discordgo.Session, message *discordgo.MessageCreate)
}
respond = true
} else if output, _ := regexp.MatchString("(http.*youtube.com/watch.*?v=.*)|(http.*youtube.com/shorts/.*)|(http.*youtu.be/.*)", url); output {
} else if output, _ := regexp.MatchString("(http.*youtube.com/watch.*?v=.*)|(http.*youtube.com/shorts/.*)|(http.*youtube.com/v/.*)|(http.*youtu.be/.*)", url); output {
log.Println("YouTube detected.")
if shortned, _ := regexp.MatchString("http.*youtu\\.be/.*", url); shortned {
if shortned, _ := regexp.MatchString("(http.*youtu\\.be/.*)|(http.*youtube.com/v/.*)", url); shortned {
var err error
log.Println("Short URL detected. Getting long version.")