Compare commits
2 commits
62df01c898
...
a526c21484
Author | SHA1 | Date | |
---|---|---|---|
a526c21484 | |||
58ff7e8edf |
1 changed files with 3 additions and 3 deletions
|
@ -38,7 +38,7 @@ func messageCreate(session *discordgo.Session, message *discordgo.MessageCreate)
|
|||
respond := false
|
||||
|
||||
for _, url := range urls {
|
||||
if output, _ := regexp.MatchString("(http.*twitter.com/.*/status)|(http.*t.co/.*)", url); output {
|
||||
if output, _ := regexp.MatchString("(http.*twitter.com/.*/status)|(http.*t.co/.*)|(http.*x.com/.*)", url); output {
|
||||
log.Println("Cringe twitter post detected.")
|
||||
|
||||
if shortned, _ := regexp.MatchString("http.*t.co/.*", url); shortned {
|
||||
|
@ -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.")
|
||||
|
|
Loading…
Reference in a new issue