diff --git a/methods.go b/methods.go index f6bf661..80280b9 100644 --- a/methods.go +++ b/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) -} diff --git a/tgapi/methods.go b/tgapi/methods.go index bf0635f..95956d8 100644 --- a/tgapi/methods.go +++ b/tgapi/methods.go @@ -1,5 +1,11 @@ package tgapi +import ( + "fmt" + "io" + "net/http" +) + type ParseMode string const ( @@ -44,3 +50,13 @@ func (api *API) GetFile(params GetFileP) (File, error) { req := NewRequest[File]("getFile", params) return req.Do(api) } + +func (api *API) GetFileByLink(link string) ([]byte, error) { + u := fmt.Sprintf("https://api.telegram.org/file/bot%s/%s", api.token, link) + res, err := http.Get(u) + if err != nil { + return nil, err + } + defer res.Body.Close() + return io.ReadAll(res.Body) +} diff --git a/utils/version.go b/utils/version.go index 04a2bef..fcbae7f 100644 --- a/utils/version.go +++ b/utils/version.go @@ -1,9 +1,9 @@ package utils const ( - VersionString = "0.8.0-beta.1" + VersionString = "0.8.0-beta.2" VersionMajor = 0 VersionMinor = 8 VersionPatch = 0 - Beta = 1 + Beta = 2 )