Nickname added
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import db from '../config/database.js';
|
||||
|
||||
export default class User {
|
||||
static async create(telegramId) {
|
||||
static async create(telegramId, username) {
|
||||
try {
|
||||
// First check if user exists
|
||||
const existingUser = await this.getById(telegramId);
|
||||
@@ -14,8 +14,8 @@ export default class User {
|
||||
|
||||
// Create new user
|
||||
const result = await db.runAsync(
|
||||
'INSERT INTO users (telegram_id) VALUES (?)',
|
||||
[telegramId.toString()]
|
||||
'INSERT INTO users (telegram_id, username) VALUES (?, ?)',
|
||||
[telegramId.toString(), username]
|
||||
);
|
||||
|
||||
// Commit transaction
|
||||
|
||||
Reference in New Issue
Block a user