Fixed false regex matches for Twitter

This commit is contained in:
Logan G 2024-06-16 15:39:25 -06:00
parent 57c0c15c82
commit a6384e362e
Signed by: logan
GPG key ID: E328528C921E7A7A

View file

@ -38,7 +38,7 @@ func messageCreate(session *discordgo.Session, message *discordgo.MessageCreate)
respond := false respond := false
for _, url := range urls { for _, url := range urls {
if output, _ := regexp.MatchString("(http.*twitter.com/.*/status)|(http.*t.co/.*)|(http.*x.com/.*)", url); output { if output, _ := regexp.MatchString("(http.*twitter.com/.*/status)|(http.*t.co/.*)|(http.*x.com/.*/status)", url); output {
log.Println("Cringe twitter post detected.") log.Println("Cringe twitter post detected.")
if shortned, _ := regexp.MatchString("http.*t.co/.*", url); shortned { if shortned, _ := regexp.MatchString("http.*t.co/.*", url); shortned {