kfei / slack-cleaner

:speech_balloon: Bulk delete messages and files on Slack
MIT License
1.24k stars 144 forks source link

Error when seeing messages from IFTTT bot #3

Open magicstone1412 opened 8 years ago

magicstone1412 commented 8 years ago

I tried to delete message from IFTTT bot but it shows the error as the attached pictures. When I ran the command slack-cleaner --token= --message --channel general --bot --perform

it deleted only 1 message from that BOT. Could you please fix it. Thank you.

https://i.imgur.com/5Z0lXok.png

kfei commented 8 years ago

It seems that some sort of messages do not have a text field. Would you try to identify what type of message it is? You can check the message object returned from Slack API (https://api.slack.com/methods/channels.history/test) Thank you!

magicstone1412 commented 8 years ago

Please see the test results

{ "ok": true, "messages": [ { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "150706_FVR-ADM-DOC-1200-0699_MS of U-Girder Load Test", "title_link": "https:\/\/locker.ifttt.com\/f\/25ae4ffd-cb86-4f7b-85a3-01414d2254ff.pdf", "thumb_url": "http:\/\/ifttt.com\/images\/no_image_card.png", "thumb_width": 400, "thumb_height": 247, "text": "\n\n", "fallback": "\n\n", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1436174938.000014" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: UMRTL1-CP2-0000-QUA-PRO-00029-B_As-Built Document Procedure", "title_link": "https:\/\/locker.ifttt.com\/f\/42c23b80-ea58-4d7f-af76-0beffcd8e186.png", "thumb_url": "https:\/\/locker.ifttt.com\/f\/a77dc11d-a942-4db0-b0ec-d37cfea145bc.png", "thumb_width": 80, "thumb_height": 81, "text": "\n\nKPOINT - Mail Details ", "fallback": "\n\nKPOINT - Mail Details ", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1436173438.000013" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: UMRTL1-CP2-VDGN-CWS-MST-00137-A_Method Statement of trial grouting for U-Girder", "title_link": "https:\/\/locker.ifttt.com\/f\/0ea8859f-b60b-49a8-85c6-6860119afce4.png", "thumb_url": "https:\/\/locker.ifttt.com\/f\/a13e9c17-b1be-4b9f-8e32-ac5469e29b41.png", "thumb_width": 80, "thumb_height": 81, "text": "\n\nKPOINT - Mail Details ", "fallback": "\n\nKPOINT - Mail Details ", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1436173437.000012" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: UMRTL1-CP2-SSDP-CVS-CTD-25148-A_DP4-1_WD for pier VD17-2_P17-09P17-21", "title_link": "https:\/\/locker.ifttt.com\/f\/49605b31-14d7-4e2f-9e12-644c16ee38de.png", "thumb_url": "https:\/\/locker.ifttt.com\/f\/b40ba3de-2ceb-4598-922c-5c740513c20d.png", "thumb_width": 80, "thumb_height": 81, "text": "\n\nKPOINT - Mail Details ", "fallback": "\n\nKPOINT - Mail Details ", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1436170537.000011" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: UMRTL1-CP2-VD08-CVS-TST-00371-A_Sonic Test Report of Bored Pile At P8-04", "title_link": "https:\/\/locker.ifttt.com\/f\/f89ec4fc-90d4-495c-b7c5-d6820d44a75b.png", "thumb_url": "https:\/\/locker.ifttt.com\/f\/0eff572f-7008-43ae-b4b3-1f2cf3ce417c.png", "thumb_width": 80, "thumb_height": 81, "text": "\n\nKPOINT - Mail Details ", "fallback": "\n\nKPOINT - Mail Details ", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1436170350.000010" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: UMRTL1-CP2-VD08-CVS-TST-00373-A_Sonic Test Report of Bored Pile At P8-45", "title_link": "https:\/\/locker.ifttt.com\/f\/584e039c-d066-4628-bdf6-bdbf5a5cded2.png", "thumb_url": "https:\/\/locker.ifttt.com\/f\/cf34a4df-62d7-4254-b311-1c96913fd3c1.png", "thumb_width": 80, "thumb_height": 81, "text": "\n\nKPOINT - Mail Details ", "fallback": "\n\nKPOINT - Mail Details ", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1436170348.000009" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: UMRTL1-CP2-STNU-CSS-CTD-47104-B_DP5-1_Working Drawings for Driven Pile - NU sta.", "title_link": "https:\/\/locker.ifttt.com\/f\/74d36145-7c95-4863-86db-e7f184979ba4.png", "thumb_url": "https:\/\/locker.ifttt.com\/f\/8b274f6a-218b-4ef8-9793-b3c430525a57.png", "thumb_width": 80, "thumb_height": 81, "text": "\n\nKPOINT - Mail Details ", "fallback": "\n\nKPOINT - Mail Details ", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1436169392.000008" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: UMRTL1-CP2-SSBT-CVS-MST-00103-C_Method Statement of superstructure work at VD11&VD12 (Solid slab viaduct section)", "title_link": "https:\/\/locker.ifttt.com\/f\/3c59dd71-5aa5-4d98-b696-ee6713b2d118.png", "thumb_url": "https:\/\/locker.ifttt.com\/f\/0f7c8c48-228c-4c71-8f28-97772f98946c.png", "thumb_width": 80, "thumb_height": 81, "text": "\n\nKPOINT - Mail Details ", "fallback": "\n\nKPOINT - Mail Details ", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1436169201.000007" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: UMRTL1-CP2-SSBT-CVS-CTD-27109-A_DP5-Working Drawing for pier cap (VD12-1 P12-01P12-04)", "title_link": "https:\/\/locker.ifttt.com\/f\/b97a608b-02ef-4064-922b-976d905a64bb.png", "thumb_url": "https:\/\/locker.ifttt.com\/f\/b0c165ea-5136-4621-8695-9ba2c54a6d05.png", "thumb_width": 80, "thumb_height": 81, "text": "\n\nKPOINT - Mail Details ", "fallback": "\n\nKPOINT - Mail Details ", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1436169033.000006" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: UMRTL1-CP2-STPL-CSS-CTD-40109-C_DP3- Working Drawings for Concourse beam and slab-PL Station", "title_link": "https:\/\/locker.ifttt.com\/f\/efc61612-01dc-42ca-bfa1-6a3416c576e2.png", "thumb_url": "https:\/\/locker.ifttt.com\/f\/b8dce5ed-283a-4dbe-99dc-011e5ef6c8de.png", "thumb_width": 80, "thumb_height": 81, "text": "\n\nKPOINT - Mail Details ", "fallback": "\n\nKPOINT - Mail Details ", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1436169032.000005" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "150706_HCMC-LSB-15-491_FVR_Misalignment of Duct in segments", "title_link": "https:\/\/locker.ifttt.com\/f\/7e86b952-0947-4abf-8aea-149be88a4123.pdf", "thumb_url": "http:\/\/ifttt.com\/images\/no_image_card.png", "thumb_width": 400, "thumb_height": 247, "text": "\n\n", "fallback": "\n\n", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1436166403.000004" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "150704_FVR-ADM-DOC-1200-0698_Report of post - tensioning friction test and Stressing Elongation Report Span P7-17-16", "title_link": "https:\/\/locker.ifttt.com\/f\/5bcc79a7-2219-4a4f-af35-e8f1ab76e707.pdf", "thumb_url": "http:\/\/ifttt.com\/images\/no_image_card.png", "thumb_width": 400, "thumb_height": 247, "text": "\n\n", "fallback": "\n\n", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435979500.000008" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "150704_FVR-ADM-DOC-1200-0696_FCN for Typical U Girder Precast Segment", "title_link": "https:\/\/locker.ifttt.com\/f\/89be9984-0e28-422b-8523-754578451c10.pdf", "thumb_url": "http:\/\/ifttt.com\/images\/no_image_card.png", "thumb_width": 400, "thumb_height": 247, "text": "\n\n", "fallback": "\n\n", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435978702.000007" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: UMRTL1-CP2-STST-CSS-RPT-00594-A_General arrangement drawing for station type D", "title_link": "https:\/\/locker.ifttt.com\/f\/fa8e1cbe-0c54-4974-967a-f601a8f62ce4.png", "thumb_url": "https:\/\/locker.ifttt.com\/f\/8bbebc6d-9ce4-42db-b64e-aefc00d8599d.png", "thumb_width": 80, "thumb_height": 81, "text": "\n\nKPOINT - Mail Details ", "fallback": "\n\nKPOINT - Mail Details ", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435973228.000006" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: UMRTL1-CP2-STTD-CSS-TFD-39003-D_DP3_TFD of Thao Dien Sta. (FD-2)- part 1_Architecture", "title_link": "https:\/\/locker.ifttt.com\/f\/57e404a4-0faf-41fd-91a4-41651e33cfca.png", "thumb_url": "https:\/\/locker.ifttt.com\/f\/476efff8-967b-4a1f-bfbf-cad799f50901.png", "thumb_width": 80, "thumb_height": 81, "text": "\n\nKPOINT - Mail Details ", "fallback": "\n\nKPOINT - Mail Details ", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435973227.000005" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: UMRTL1-CP2-STTD-CSS-CTD-39112-B_DP3- Working Drawings for Concourse beam and slab-CB20-Thao Dien Station", "title_link": "https:\/\/locker.ifttt.com\/f\/244ca513-4600-4cbf-9e0e-2f375aad7428.png", "thumb_url": "https:\/\/locker.ifttt.com\/f\/0be40127-c3de-4eb0-8913-c502cc31f412.png", "thumb_width": 80, "thumb_height": 81, "text": "\n\nKPOINT - Mail Details ", "fallback": "\n\nKPOINT - Mail Details ", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435973226.000004" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: UMRTL1-CP2-VDGN-CVS-FCN-00010-B_FCN-DP2_WD for typical U-Girder Precast Segment (Code 1A 35m straight)", "title_link": "https:\/\/locker.ifttt.com\/f\/7d15fbcf-9e99-499d-a152-5060cdce0a14.png", "thumb_url": "https:\/\/locker.ifttt.com\/f\/d44341fa-2930-4e56-bd0d-a2a51f4d0e87.png", "thumb_width": 80, "thumb_height": 81, "text": "\n\nKPOINT - Mail Details ", "fallback": "\n\nKPOINT - Mail Details ", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435973223.000003" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: UMRTL1-CP2-STTD-CSS-FCN-00013-A_FCN-DP3_WD for Concourse beam & slab - (Thao Dien Station)", "title_link": "https:\/\/locker.ifttt.com\/f\/ba205dcc-859e-4cca-af78-1d35bd77ebb0.png", "thumb_url": "https:\/\/locker.ifttt.com\/f\/43b0d28d-3a27-43b4-8f4f-6f9ebd2e3fdb.png", "thumb_width": 80, "thumb_height": 81, "text": "\n\nKPOINT - Mail Details ", "fallback": "\n\nKPOINT - Mail Details ", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435973222.000002" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: UMRTL1-CP2-STTD-CSS-CTD-39111-B_DP 3_WD for platform beam and slab - Thao Dien Station - Concourse and platform level RC structure", "title_link": "https:\/\/locker.ifttt.com\/f\/f00614c2-0402-442d-b24f-b3f094837cf6.png", "thumb_url": "https:\/\/locker.ifttt.com\/f\/15220b8f-5adc-46f2-8705-5647d5de5ce5.png", "thumb_width": 80, "thumb_height": 81, "text": "\n\nKPOINT - Mail Details ", "fallback": "\n\nKPOINT - Mail Details ", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435917837.000012" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "150703_HCMC-LSB-15-489_FVR_Notice of Knowledge of Event that gives rise to a Claim - Precast Yard Segment Storage & Ground Settlement", "title_link": "https:\/\/locker.ifttt.com\/f\/a7e0345a-350c-4f48-b3c2-42f48f0dea41.pdf", "thumb_url": "http:\/\/ifttt.com\/images\/no_image_card.png", "thumb_width": 400, "thumb_height": 247, "text": "\n\n", "fallback": "\n\n", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435917836.000011" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: CP2_LSC6C.NJPT.EVC.1507E-0087_Lessons learned from latest incident- Safety Requirement", "title_link": "https:\/\/locker.ifttt.com\/f\/a940f0f2-0717-4046-bd15-b25699a1a033.png", "text": "\n\nKPOINT - Mail Details", "fallback": "\n\nKPOINT - Mail Details", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435916853.000010" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: CP2\/NCR\/93A_Nonconformity Report", "title_link": "https:\/\/locker.ifttt.com\/f\/bdca5056-0a1d-4296-9b20-1db1d603ba78.pdf", "thumb_url": "http:\/\/ifttt.com\/images\/no_image_card.png", "thumb_width": 400, "thumb_height": 247, "text": "\n\nKPOINT - New Correspondence", "fallback": "\n\nKPOINT - New Correspondence", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435910187.000003" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: UMRTL1-CP2-VDGN-CVS-CTD-22128-A_DP2_WD for Typical U-Girder Precast Segment (Code 5B-Transition Span)", "title_link": "https:\/\/locker.ifttt.com\/f\/6061e78d-c190-4468-8067-98b9a8442d90.png", "thumb_url": "http:\/\/ifttt.com\/images\/no_image_card.png", "thumb_width": 400, "thumb_height": 247, "text": "\n\nKPOINT - Mail Details ", "fallback": "\n\nKPOINT - Mail Details ", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435889924.000002" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "150702_HCMC-LSB-15-487_FVR_Nonconformity Report on Cracks Appearance on Segment No.P7-15-16-S4", "title_link": "https:\/\/locker.ifttt.com\/f\/b74bccd7-631e-41bb-b44f-d6b18b658ee9.pdf", "thumb_url": "http:\/\/ifttt.com\/images\/no_image_card.png", "thumb_width": 400, "thumb_height": 247, "text": "\n\n", "fallback": "\n\n", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435829821.000007" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "150702_HCMC-LSB-15-486_FVR_Notice of Knowledge of event that gives rise to a claim -Precast Yard Segment storage and ground settlement", "title_link": "https:\/\/locker.ifttt.com\/f\/8e21fb22-4cf7-47ae-834b-6d2b43fd7f70.pdf", "thumb_url": "http:\/\/ifttt.com\/images\/no_image_card.png", "thumb_width": 400, "thumb_height": 247, "text": "\n\n", "fallback": "\n\n", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435829669.000006" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "FW: UMRTL1-CP2-VD07-CWS-RPT-00600-A_Report of elongation records for span P7-16(17)", "title_link": "https:\/\/locker.ifttt.com\/f\/4d380a65-0657-4120-9108-e41fe47c7be0.png", "thumb_url": "http:\/\/ifttt.com\/images\/no_image_card.png", "thumb_width": 400, "thumb_height": 247, "text": "\n\nKPOINT - Mail Details ", "fallback": "\n\nKPOINT - Mail Details ", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435828943.000005" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "150701_FVR-ADM-DOC-1200-0694_MS Segment storage at site", "title_link": "https:\/\/locker.ifttt.com\/f\/f6f8ab8f-f731-4f2d-ae9c-0a2e37ce6f13.pdf", "thumb_url": "https:\/\/locker.ifttt.com\/f\/f6f8ab8f-f731-4f2d-ae9c-0a2e37ce6f13.pdf", "thumb_width": 400, "thumb_height": 247, "text": "150701_FVR-ADM-DOC-1200-0694_MS Segment storage at site", "fallback": "150701_FVR-ADM-DOC-1200-0694_MS Segment storage at site", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435741175.000025" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "150630_HCMC-LSB-15-480_FVR_Detail & Arrangement of Starter Bars for Expansion Joint in Typical U-Girder", "title_link": "https:\/\/locker.ifttt.com\/f\/1a158a6a-0a04-4b9c-aec4-48d514570bf5.pdf", "thumb_url": "https:\/\/locker.ifttt.com\/f\/1a158a6a-0a04-4b9c-aec4-48d514570bf5.pdf", "thumb_width": 400, "thumb_height": 247, "text": "150630_HCMC-LSB-15-480_FVR_Detail & Arrangement of Starter Bars for Expansion Joint in Typical U-Girder", "fallback": "150630_HCMC-LSB-15-480_FVR_Detail & Arrangement of Starter Bars for Expansion Joint in Typical U-Girder", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435728646.000018" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "150630_HCMC-LSB-15-483_FVR_Notice of Rebar Order Plan for Segments Fabrication", "title_link": "https:\/\/locker.ifttt.com\/f\/c185b17e-96a7-4843-9d6e-9ea821be16c7.pdf", "thumb_url": "https:\/\/locker.ifttt.com\/f\/c185b17e-96a7-4843-9d6e-9ea821be16c7.pdf", "thumb_width": 400, "thumb_height": 247, "text": "150630_HCMC-LSB-15-483_FVR_Notice of Rebar Order Plan for Segments Fabrication", "fallback": "150630_HCMC-LSB-15-483_FVR_Notice of Rebar Order Plan for Segments Fabrication", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435728645.000016" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "150701_FVR-ADM-DOC-1200-0693_CP2-NCR-84 A and Notice of Event that give raise to a claim-station interface segments...", "text": "\n\n", "fallback": "\n\n", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435721793.000014" }, { "username": "IFTTT", "icons": { "image_48": "https:\/\/slack.global.ssl.fastly.net\/7bf4\/img\/services\/ifttt_48.png" }, "attachments": [ { "title": "150701_FVR-ADM-DOC-1200-0692_MS of Grouting Trail", "text": "\n\n", "fallback": "\n\n", "mrkdwn_in": [ "text", "pretext" ] } ], "mrkdwn": true, "type": "message", "subtype": "bot_message", "ts": "1435721647.000013" } ], "has_more": false }

Taznc commented 8 years ago

I love this program but I have the exact same issue. Running again will delete the message but then it will get hung up on the next IFTTT BOT message. Please let me know if you need any information.

ChrisSLT commented 8 years ago

Awesome program - thank you! I have the same issue. My guess is that IFTTT is sending data in slack's message attachments format (https://api.slack.com/docs/attachments). Is this able to be fixed for these scenarios?

Also - FYI - what happens when you run it is that it throws an error and only deletes 1 message. So it's working but just getting tripped up inside the loop statement?

ChrisSLT commented 8 years ago

I've just confirmed this error with the bot user "meekan" which does calendar scheduling. Meekan is posting using the json structure outlined here: https://api.slack.com/docs/attachments and slack cleaner throws an error and is not able to delete it. I wish I knew python and could help but all I can do is report and encourage!

Taznc commented 8 years ago

I looked at this a little further today and I was able to get slack cleaner to not error for the IFTTT posts. It appears that it is having issues with the message text being empty.

I was able to bypass this by modifying the cli.py file.

I changed this: logger.warning(Colors.RED + 'Deleted message -> ' + Colors.ENDC

To this: logger.warning(Colors.RED + 'Deleted message -> ' + Colors.ENDC

This allows the slack cleaner to run successfully. This does, however, stop the application from posting the message text to the console. This does not matter to me.

I am sure there is a better way to resolve this by checking if the message is null or something.

I hope this helps.

ChrisSLT commented 8 years ago

Thanks! I'm sure it well help. As to my post about Meekan, I think the problem is that Meekan uses it's on API key and so there's just no way slack cleaner can get rid of its messages.

Taznc commented 8 years ago

Have you tried running Slack Cleaner with Meekah's API key?

ChrisSLT commented 8 years ago

That's probably the solution! Do you know how I get it? are API keys for all bots I "add to slack" available to me or do I have to beg the developer?

kfei commented 8 years ago

Thank you guys. This should be fixed in v0.1.4.

@Taznc @ChrisSLT , I feel it's quite annoying that Slack doesn't provide a root API key which has a super privilege can delete all messages even from 3rd party applications.

ChrisSLT commented 8 years ago

Exactly!

On Wed, Feb 17, 2016 at 3:18 PM, LIN, KE-FEI notifications@github.com wrote:

Thank you guys. This should be fixed in v0.1.4.

@Taznc https://github.com/Taznc @ChrisSLT https://github.com/ChrisSLT , I feel it's quite annoying that Slack doesn't provide a root API key which has a super privilege can delete all messages even from 3rd party applications.

— Reply to this email directly or view it on GitHub https://github.com/kfei/slack-cleaner/issues/3#issuecomment-185385398.