update
This commit is contained in:
+8
-4
@@ -66,11 +66,15 @@ func init() {
|
|||||||
b.Send(ct, s)
|
b.Send(ct, s)
|
||||||
for _, path := range paths {
|
for _, path := range paths {
|
||||||
func() {
|
func() {
|
||||||
f, err := os.Open(path)
|
data, err := os.ReadFile(path)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
defer f.Close()
|
url := regexp.MustCompile("(https.*)").FindString(string(data))
|
||||||
b.Send(ct, path)
|
if url != "" {
|
||||||
b.SendAlbum(ct, tb.Album{&tb.Photo{File: tb.FromReader(f)}})
|
rsp, err := httplib.Get(url).Response()
|
||||||
|
if err == nil {
|
||||||
|
b.SendAlbum(ct, tb.Album{&tb.Photo{File: tb.FromReader(rsp.Body)}})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user