0.8.0 beta 2
This commit is contained in:
13
methods.go
13
methods.go
@@ -2,9 +2,6 @@ package laniakea
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"git.nix13.pw/scuroneko/laniakea/tgapi"
|
||||
)
|
||||
@@ -39,13 +36,3 @@ func (bot *Bot[T]) Updates() ([]tgapi.Update, error) {
|
||||
}
|
||||
return updates, err
|
||||
}
|
||||
|
||||
func (bot *Bot[T]) GetFileByLink(link string) ([]byte, error) {
|
||||
u := fmt.Sprintf("https://api.telegram.org/file/bot%s/%s", bot.token, link)
|
||||
res, err := http.Get(u)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer res.Body.Close()
|
||||
return io.ReadAll(res.Body)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user