many changes; using dev laniakea
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package plugins
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
@@ -11,7 +12,6 @@ import (
|
||||
|
||||
"git.nix13.pw/scuroneko/laniakea"
|
||||
"git.nix13.pw/scuroneko/laniakea/tgapi"
|
||||
"git.nix13.pw/scuroneko/laniakea/utils"
|
||||
"github.com/vinovest/sqlx"
|
||||
)
|
||||
|
||||
@@ -58,7 +58,9 @@ func execSql(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
ctx.Error(err)
|
||||
return
|
||||
}
|
||||
defer r.Close()
|
||||
defer func(r *sql.Rows) {
|
||||
_ = r.Close()
|
||||
}(r)
|
||||
for r.Next() {
|
||||
a := make(map[string]any)
|
||||
if err = sqlx.MapScan(r, a); err != nil {
|
||||
@@ -96,7 +98,9 @@ func uploadPhoto(ctx *laniakea.MsgContext, _ *database.Context) {
|
||||
return
|
||||
}
|
||||
u := tgapi.NewUploader(ctx.Api)
|
||||
defer u.Close()
|
||||
defer func(u *tgapi.Uploader) {
|
||||
_ = u.Close()
|
||||
}(u)
|
||||
content, err := ctx.Api.GetFileByLink(f.FilePath)
|
||||
if err != nil {
|
||||
ctx.Error(err)
|
||||
@@ -111,5 +115,5 @@ func uploadPhoto(ctx *laniakea.MsgContext, _ *database.Context) {
|
||||
ctx.Error(err)
|
||||
return
|
||||
}
|
||||
ctx.Answer(utils.EscapeMarkdown(msg.Photo.Last().FileID))
|
||||
ctx.Answer(msg.Photo.Last().FileID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user