[im.history](https://api.slack.com/methods/im.history) has an optional arg about count, could be used to specify number of messages to delete during the iteration, etc.