scaffolding for new seasons

This commit is contained in:
2026-02-02 19:12:14 +11:00
parent 9366481552
commit 9c70458b76
21 changed files with 520 additions and 41 deletions

View File

@@ -26,20 +26,6 @@ func (user *User) GetID() int {
return user.ID
}
// Change the user's username
func (user *User) ChangeUsername(ctx context.Context, tx bun.Tx, newUsername string) error {
_, err := tx.NewUpdate().
Model(user).
Set("username = ?", newUsername).
Where("id = ?", user.ID).
Exec(ctx)
if err != nil {
return errors.Wrap(err, "tx.NewUpdate")
}
user.Username = newUsername
return nil
}
// CreateUser creates a new user with the given username and password
func CreateUser(ctx context.Context, tx bun.Tx, username string, discorduser *discordgo.User) (*User, error) {
if discorduser == nil {