Final update for 400 bad request
This commit is contained in:
parent
dbd1a46349
commit
a98243c194
13
message.go
13
message.go
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user