Skip to content

Commit

Permalink
Change RP layout (now displaying login, campus and download link)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandregv committed Nov 5, 2019
1 parent 0e0dde4 commit ed96490
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/RP42/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ func sendActivity(details string, state string, largeText string, smallImage str

func setPresence(user *api.User, location *api.Location, coalition *api.Coalition) {
lvl := fmt.Sprintf("%.2f", user.CursusUsers[0].Level)
login := user.Login
campus := user.Campus[0].Name

var (
start int64
Expand All @@ -79,9 +81,9 @@ func setPresence(user *api.User, location *api.Location, coalition *api.Coalitio
}

sendActivity(
fmt.Sprint("Level: ", lvl),
fmt.Sprint("Location: ", loc),
user.Login,
fmt.Sprintf("%s | Lvl %s", login, lvl),
fmt.Sprintf("%s in %s", loc, campus),
"Download: git.io/Je2xQ",
coaSlug,
coaName,
start,
Expand Down
6 changes: 6 additions & 0 deletions pkg/api/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,13 @@ type User struct {
CreatedAt time.Time `json:"created_at"`
UserID int `json:"user_id"`
} `json:"expertises_users"`
*/
Campus []struct {
/*
ID int `json:"id"`
*/
Name string `json:"name"`
/*
TimeZone string `json:"time_zone"`
Language struct {
ID int `json:"id"`
Expand All @@ -90,7 +94,9 @@ type User struct {
} `json:"language"`
UsersCount int `json:"users_count"`
VogsphereID int `json:"vogsphere_id"`
*/
} `json:"campus"`
/*
CampusUsers []struct {
ID int `json:"id"`
UserID int `json:"user_id"`
Expand Down
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ed96490

Please sign in to comment.