免费版Slack的workspace最多只支持最近的10000件聊天记录查看,如果能定期保存的话比较方便阅览。
-
从https://api.slack.com/custom-integrations/legacy-tokens取得token
选择【Legacy information】下的【Create token】按钮取得token。
※看不到token发行按钮时,点击右上角的【Go to Slack】登录对象workspace,再打开上面的网址。
※显示【Request token】按钮时说明管理员设置了权限,需要管理员许可才能申请 -
聊天记录取得
D:\>cd D:\slack-dump-v1.1.3-windows-amd64\windows-amd64
D:\slack-dump-v1.1.3-windows-amd64\windows-amd64>slack-dump -t=【取得的token】
利用slack-export-viewer可以查看聊天记录文件,但是有两个问题
- 文件路径不一致,slack-export-viewer默认所有的channel聊天记录文件夹在zip的根目录下,如下:
聊天记录.zip
│ channels.json
│ users.json
│
└───channel1
│ │ 聊天记录1.json
│ └───...
└───channel2
│ │ 聊天记录1.json
│ └───...
└───...
而slack-dump输出的channel聊天记录文件夹在相应类别文件夹下,如下:
聊天记录.zip
│ channels.json
│ users.json
│
└───channel
│ └───channel1
│ │ │ 聊天记录1.json
│ │ └───...
│ └───channel2
│ │ │ 聊天记录1.json
│ │ └───...
│ └───...
└───direct_message
│ └───channel1
│ │ │ 聊天记录1.json
│ │ └───...
│ └───channel2
│ │ │ 聊天记录1.json
│ │ └───...
│ └───...
└───private_channel
└───channel1
│ │ 聊天记录1.json
│ └───...
└───channel2
│ │ 聊天记录1.json
│ └───...
└───...
所以使用前要把slack-dump输出的zip文件解压后,把所有的channel聊天记录文件夹剪切到根目录下重新打包
- 所有的channel都被当成public channel显示。TODO:原因调查