diff --git a/message.go b/message.go index ac73d31..56b02a2 100644 --- a/message.go +++ b/message.go @@ -109,8 +109,17 @@ func (s *Session) ArchiveMessages(ids []string) error { return fmt.Errorf("ID list was empty") } - payload := map[string][]string{ - "messageIds": ids, + var newList []int + 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)