Рефакторинг хранения пользователей: переход с JSON на PostgreSQL через Prisma

This commit is contained in:
Zwuck
2025-12-16 15:52:20 +05:00
parent ed95f7c115
commit 1ac12251f1
3 changed files with 41 additions and 80 deletions

View File

@@ -13,7 +13,7 @@ export class BotService {
async start(@Ctx() ctx: Context) {
const user = ctx.from;
if (user) {
this.usersService.create({
await this.usersService.create({
id: user.id,
fullName: `${user.first_name} ${user.last_name || ''}`.trim(),
});
@@ -41,7 +41,7 @@ export class BotService {
if (!user) return;
const hours = parseInt(ctx.match[1]);
this.usersService.update(user.id, { frequency: hours });
await this.usersService.update(user.id, { frequency: hours });
await ctx.answerCbQuery();
await ctx.editMessageText(`Отлично! Теперь я буду присылать цитаты каждые ${hours} ч.`);