small pixel drawing of a pufferfish neoarkbot

*
j3s j3s@c3f.net
Wed, 17 Mar 2021 18:06:49 -0500
commit

a89cdac04e9ba3a175444cce633b6a2f722c18fb

parent

a812dfcaea49c0ef76e48150e0523d89e25c2d9c

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M main.gomain.go

@@ -71,13 +71,13 @@ list := strings.Join(keys, "\n")

e.Sender.Send(list) } var file string - matched, err := regexp.MatchString(`https:\/\/(www.)?youtube\.com\/watch\?v=[A-z_0-9]{11}`, e.Message) + matched, err := regexp.MatchString(`https:\/\/(www.)?youtube\.com\/watch\?v=[A-z_\-0-9]{11}`, e.Message) if err != nil { fmt.Printf("regex match blew up: %s", err) return } if matched && strings.HasPrefix(e.Message, "!") { - m := regexp.MustCompile(`https:\/\/(www.)?youtube\.com\/watch\?v=[A-z_0-9]{11}`) + m := regexp.MustCompile(`https:\/\/(www.)?youtube\.com\/watch\?v=[A-z_\-0-9]{11}`) videoUrl := m.FindString(e.Message) fmt.Println("downloading...") parts := strings.Split(videoUrl, "?v=")