"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.saveUser = saveUser;
const User_1 = require("../models/User");
function saveUser(ctx) {
    if (!ctx.from)
        return;
    const { id, username, first_name, last_name } = ctx.from;
    try {
        User_1.UserModel.upsert({
            telegramId: id,
            username,
            firstName: first_name,
            lastName: last_name,
        });
    }
    catch (_) { }
}
