Final update for 400 bad request

This commit is contained in:
itzaname 2017-01-08 01:35:08 -05:00
parent dbd1a46349
commit a98243c194

View File

@ -109,8 +109,17 @@ func (s *Session) ArchiveMessages(ids []string) error {
return fmt.Errorf("ID list was empty") return fmt.Errorf("ID list was empty")
} }
payload := map[string][]string{ var newList []int
"messageIds": ids, for i := 0; i < len(ids); i++ {
idString, err := strconv.Atoi(ids[i])
if err != nil {
return err
}
newList = append(newList, idString)
}
payload := map[string][]int{
"messageIds": newList,
} }
data, err := json.Marshal(&payload) data, err := json.Marshal(&payload)