@@ -21,6 +21,7 @@ type User struct {
21
21
Country string `db:"country"`
22
22
AvatarUrl sql.NullString `db:"avatar_url"`
23
23
TwitchUsername sql.NullString `db:"twitch_username"`
24
+ ClanId sql.NullInt32 `db:"clan_id"`
24
25
}
25
26
26
27
// GetProfileUrl Returns the full profile url for the user
@@ -30,7 +31,7 @@ func (u *User) GetProfileUrl() string {
30
31
31
32
// GetUserById Retrieves a user from the database by their id
32
33
func GetUserById (id int ) (* User , error ) {
33
- query := "SELECT id, steam_id, username, allowed, privileges, usergroups, mute_endtime, country, avatar_url, twitch_username FROM users WHERE id = ? LIMIT 1"
34
+ query := "SELECT id, steam_id, username, allowed, privileges, usergroups, mute_endtime, country, avatar_url, twitch_username, clan_id FROM users WHERE id = ? LIMIT 1"
34
35
35
36
var user User
36
37
err := SQL .Get (& user , query , id )
@@ -44,7 +45,7 @@ func GetUserById(id int) (*User, error) {
44
45
45
46
// GetUserBySteamId Retrieves a user from the database by their Steam id
46
47
func GetUserBySteamId (steamId string ) (* User , error ) {
47
- query := "SELECT id, steam_id, username, allowed, privileges, usergroups, mute_endtime, country, avatar_url, twitch_username FROM users WHERE steam_id = ? LIMIT 1"
48
+ query := "SELECT id, steam_id, username, allowed, privileges, usergroups, mute_endtime, country, avatar_url, twitch_username, clan_id FROM users WHERE steam_id = ? LIMIT 1"
48
49
49
50
var user User
50
51
err := SQL .Get (& user , query , steamId )
@@ -58,7 +59,7 @@ func GetUserBySteamId(steamId string) (*User, error) {
58
59
59
60
// GetUserByUsername Rerieves a user from the database by their username
60
61
func GetUserByUsername (username string ) (* User , error ) {
61
- query := "SELECT id, steam_id, username, allowed, privileges, usergroups, mute_endtime, country, avatar_url, twitch_username FROM users WHERE username = ? LIMIT 1"
62
+ query := "SELECT id, steam_id, username, allowed, privileges, usergroups, mute_endtime, country, avatar_url, twitch_username, clan_id FROM users WHERE username = ? LIMIT 1"
62
63
63
64
var user User
64
65
err := SQL .Get (& user , query , username )
0 commit comments