Рефакторинг хранения пользователей: переход с JSON на PostgreSQL через Prisma
This commit is contained in:
@@ -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} ч.`);
|
||||
|
||||
Reference in New Issue
Block a user