feat: smarter bot

This commit is contained in:
2026-07-07 23:23:12 +03:30
parent e7b2e05428
commit 525cd554ef
4 changed files with 112 additions and 37 deletions
+2 -2
View File
@@ -42,9 +42,9 @@ func (r *Repo) FindByID(ctx context.Context, id int64) (*User, error) {
return scan(row)
}
// Create کاربر جدید می‌سازد.
// Create کاربر جدید می‌سازد (با هدیه‌ی خوش‌آمدِ ۱۰۰ سکه).
func (r *Repo) Create(ctx context.Context, mobile string) (*User, error) {
res, err := r.db.ExecContext(ctx, `INSERT INTO users (mobile) VALUES (?)`, mobile)
res, err := r.db.ExecContext(ctx, `INSERT INTO users (mobile, coins) VALUES (?, 100)`, mobile)
if err != nil {
return nil, err
}