laniakea v1.0.0 rc1
This commit is contained in:
@@ -107,7 +107,7 @@ func uploadPhoto(ctx *laniakea.MsgContext, _ *database.Context) {
|
||||
return
|
||||
}
|
||||
filename := filepath.Base(f.FilePath)
|
||||
msg, err := u.UploadPhoto(tgapi.UploadPhotoP{
|
||||
msg, err := u.SendPhoto(tgapi.UploadPhotoP{
|
||||
ChatID: ctx.Msg.Chat.ID,
|
||||
Caption: ctx.Msg.Caption,
|
||||
}, tgapi.NewUploaderFile(filename, content))
|
||||
|
||||
@@ -189,14 +189,14 @@ func rpWaifuSet(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
return
|
||||
}
|
||||
rpRepRed := red.NewRPRepository(db)
|
||||
err = rpRepRed.SetSelectedWaifu(ctx.FromID, waifuId)
|
||||
err = rpRepRed.SetSelectedWaifu(ctx.FromID, int64(waifuId))
|
||||
if err != nil {
|
||||
ctx.Error(err)
|
||||
return
|
||||
}
|
||||
//rpRepPsql := psql.NewRPRepository(db)
|
||||
waifuRep := psql.NewWaifuRepository(db)
|
||||
waifu, err := waifuRep.GetById(waifuId)
|
||||
waifu, err := waifuRep.GetById(int64(waifuId))
|
||||
if err != nil {
|
||||
ctx.Error(err)
|
||||
}
|
||||
@@ -756,7 +756,7 @@ func generate(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
}
|
||||
|
||||
tokens := redisRpRep.GetChatTokens(ctx.FromID, waifuId)
|
||||
tokens += len(userMessage) + len(answerContent)
|
||||
tokens += int64(len(userMessage) + len(answerContent))
|
||||
err = redisRpRep.SetChatTokens(ctx.FromID, waifuId, tokens)
|
||||
if err != nil {
|
||||
ctx.Error(err)
|
||||
@@ -780,7 +780,7 @@ func generate(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
m.Delete()
|
||||
}
|
||||
case "tokens":
|
||||
if tokens >= rpUser.CompressLimit*1000 {
|
||||
if tokens >= int64(rpUser.CompressLimit*1000) {
|
||||
m = ctx.Answer("Запущено сжатие чата…")
|
||||
_compress(ctx, db)
|
||||
m.Delete()
|
||||
@@ -966,7 +966,7 @@ func _compress(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
if err != nil {
|
||||
ctx.Error(err)
|
||||
}
|
||||
err = redisRpRep.SetChatTokens(ctx.FromID, waifuId, tokens)
|
||||
err = redisRpRep.SetChatTokens(ctx.FromID, waifuId, int64(tokens))
|
||||
if err != nil {
|
||||
ctx.Error(err)
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ func waifuSell(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
}
|
||||
|
||||
rep := psql.NewWaifuRepository(db)
|
||||
waifu, err := rep.GetById(waifuId)
|
||||
waifu, err := rep.GetById(int64(waifuId))
|
||||
if err != nil {
|
||||
ctx.Error(err)
|
||||
return
|
||||
@@ -164,7 +164,7 @@ func waifuInfo(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
}
|
||||
|
||||
rep := psql.NewWaifuRepository(db)
|
||||
waifu, err := rep.GetById(waifuId)
|
||||
waifu, err := rep.GetById(int64(waifuId))
|
||||
if err != nil {
|
||||
ctx.Error(err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user