diff options
author | Alexander Kiryukhin <a.kiryukhin@mail.ru> | 2019-04-09 18:05:20 +0300 |
---|---|---|
committer | Alexander Kiryukhin <a.kiryukhin@mail.ru> | 2019-04-09 18:05:20 +0300 |
commit | 8a0b9cfac18ff685e0c69bc61352931e0305c288 (patch) | |
tree | ba5d82aef56b5d5a407866772a48ccbeba492340 /api.go | |
parent | 9ce24ee41c5649ca5a03edf60bef1606dca6a8d3 (diff) |
Fix send to groupsv0.1.0
Diffstat (limited to 'api.go')
-rw-r--r-- | api.go | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -222,7 +222,7 @@ func (a *Api) SendAction(chatID int64, action SenderAction) (*SimpleQueryResult, func (a *Api) GetMessages(chatID int64, messageIDs []string, from int64, to int64, count int64) (*MessageList, error) { result := new(MessageList) values := url.Values{} - if chatID > 0 { + if chatID != 0 { values.Set("chat_id", strconv.Itoa(int(chatID))) } if len(messageIDs) > 0 { @@ -230,11 +230,11 @@ func (a *Api) GetMessages(chatID int64, messageIDs []string, from int64, to int6 values.Add("message_ids", mid) } } - if from > 0 { + if from != 0 { values.Set("from", strconv.Itoa(int(from))) } - if to > 0 { - values.Set("count", strconv.Itoa(int(to))) + if to != 0 { + values.Set("to", strconv.Itoa(int(to))) } if count > 0 { values.Set("count", strconv.Itoa(int(count))) @@ -250,10 +250,10 @@ func (a *Api) GetMessages(chatID int64, messageIDs []string, from int64, to int6 func (a *Api) SendMessage(chatID int64, userID int64, message *NewMessageBody) (*Message, error) { result := new(Message) values := url.Values{} - if chatID > 0 { + if chatID != 0 { values.Set("chat_id", strconv.Itoa(int(chatID))) } - if userID > 0 { + if userID != 0 { values.Set("user_id", strconv.Itoa(int(userID))) } body, err := a.request(http.MethodPost, "messages", values, message) |