all database switched to repository model. some other fixes and features

This commit is contained in:
2026-01-22 20:58:46 +03:00
parent 804d683f9e
commit 331f6854b6
14 changed files with 283 additions and 187 deletions

View File

@@ -13,8 +13,9 @@ func RegisterAdmin(b *laniakea.Bot) {
b.AddPlugins(p.Build())
}
func uploadPhoto(msgContext *laniakea.MsgContext, _ *laniakea.DatabaseContext) {
user, err := psql.GetOrCreateUser(msgContext.FromID, msgContext.Msg.From.FirstName)
func uploadPhoto(msgContext *laniakea.MsgContext, db *laniakea.DatabaseContext) {
rep := psql.NewUserRepository(db)
user, err := rep.GetOrCreate(msgContext.FromID, msgContext.Msg.From.FirstName)
if err != nil {
msgContext.Error(err)
return