Skip to content

Commit

Permalink
🧹 Remove extra tab
Browse files Browse the repository at this point in the history
  • Loading branch information
barbarbar338 committed Jul 23, 2021
1 parent f125510 commit 2ba6a25
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@ func singlePresenceUpdate(client WSClient, message string) (*LanyardData, error)

func multiplePresenceUpdate(client WSClient, message string) ([]*LanyardData, error) {
var data map[string]json.RawMessage
err := json.Unmarshal([]byte(message), &data)
if err != nil {
return []*LanyardData{}, err
}
err := json.Unmarshal([]byte(message), &data)
if err != nil {
return []*LanyardData{}, err
}

var userMap map[string]json.RawMessage
err = json.Unmarshal([]byte(data["d"]), &userMap)
if err != nil {
return []*LanyardData{}, err
}

var userMap map[string]json.RawMessage
err = json.Unmarshal([]byte(data["d"]), &userMap)
var userDatas []*LanyardData
for _, item := range userMap {
var userData *LanyardData
err := json.Unmarshal(item, &userData)
if err != nil {
return []*LanyardData{}, err
}

var userDatas []*LanyardData
for _, item := range userMap {
var userData *LanyardData
err := json.Unmarshal(item, &userData)
if err != nil {
return []*LanyardData{}, err
}

userDatas = append(userDatas, userData)
}
userDatas = append(userDatas, userData)
}

return userDatas, nil
}
Expand Down

0 comments on commit 2ba6a25

Please sign in to comment.