added /match/chat endpoint

This commit is contained in:
2022-01-29 21:03:10 +01:00
parent 3bdcdecb68
commit 2ab620ec54
3 changed files with 59 additions and 9 deletions

View File

@@ -76,7 +76,7 @@ type CommunityXML struct {
VanityURL string `xml:"customURL"`
}
type shareCodeResponse struct {
type ShareCodeResponse struct {
Result struct {
Code string `json:"nextcode"`
} `json:"result"`
@@ -155,6 +155,13 @@ type MateResponse struct {
Total int `json:"total,omitempty"`
}
type ChatResponse struct {
Player *PlayerResponse `json:"player,omitempty"`
Message string `json:"message"`
AllChat bool `json:"teamChat"`
Tick int `json:"tick"`
}
type WeaponDmg struct {
Eq int `json:"eq"`
Dmg uint `json:"dmg"`
@@ -563,7 +570,7 @@ func getNextShareCode(lastCode string, apiKey string, authCode string, steamId u
return "", err
}
rJson := new(shareCodeResponse)
rJson := new(ShareCodeResponse)
err = json.Unmarshal(bJson, rJson)
if err != nil {
return "", err