hisabimbola / slack-history-export

A NPM module that allows slack users export their history

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Any way of reversing the order of messages in export?

briantully opened this issue · comments

Just exported a channel's messages, however in the json file they are listed in reverse order, i.e., the latest message is listed first. Is there any way to provide an option so that the messages can be exported in natural order, from oldest to newest?

Hi briantully,

I found it weird also, when I was implementing it but currently the slack API does not provide a way to sort in asc or desc order, I will see if I can reverse the file after downloading it.

If you have jq installed, you can pipe the output of slack-history-export to jq 'reverse' to reverse it.