Merge pull request #31 from akshtshrma24/fixParser

Account for discord webhook IDs with length 19
This commit is contained in:
Ben Cox
2022-08-12 17:15:22 +01:00
committed by GitHub
+1 -1
View File
@@ -84,7 +84,7 @@ func checkWhURL(whURL string) {
log.Fatalf("The Discord WebHook URL doesn't seem to be a valid URL.")
}
re := regexp.MustCompile(`https://discord(?:app)?.com/api/webhooks/[0-9]{18}/[a-zA-Z0-9_-]+`)
re := regexp.MustCompile(`https://discord(?:app)?.com/api/webhooks/[0-9]{18,19}/[a-zA-Z0-9_-]+`)
if ok := re.Match([]byte(whURL)); !ok {
log.Printf("The Discord WebHook URL doesn't seem to be valid.")
}