feat: smarter bot
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user