Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
alaingilbert committed Aug 18, 2022
1 parent deefa21 commit e7bbee3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ogame.go
Original file line number Diff line number Diff line change
Expand Up @@ -2015,19 +2015,19 @@ func (b *OGame) sendMessage(id int64, message string, isPlayer bool) error {
payload.Set("associationId", FI64(id))
payload.Set("mode", "3")
}
bobyBytes, err := b.postPageContent(url.Values{"page": {"ajaxChat"}}, payload)
bodyBytes, err := b.postPageContent(url.Values{"page": {"ajaxChat"}}, payload)
if err != nil {
return err
}
if strings.Contains(string(bobyBytes), "INVALID_PARAMETERS") {
if strings.Contains(string(bodyBytes), "INVALID_PARAMETERS") {
return errors.New("invalid parameters")
}
doc, _ := goquery.NewDocumentFromReader(strings.NewReader(string(bobyBytes)))
doc, _ := goquery.NewDocumentFromReader(strings.NewReader(string(bodyBytes)))
if doc.Find("title").Text() == "OGame Lobby" {
return ErrNotLogged
}
var res ChatPostResp
if err := json.Unmarshal(bobyBytes, &res); err != nil {
if err := json.Unmarshal(bodyBytes, &res); err != nil {
return err
}
b.ajaxChatToken = res.NewToken
Expand Down

0 comments on commit e7bbee3

Please sign in to comment.