Skip to content

Instantly share code, notes, and snippets.

@SamRH
SamRH / slackhecks.js
Created November 21, 2017 02:44
Slack Auto-Delete Specific Users Messsages
/* Execute this in the slack developer console - can access it by spam clicking team icons
* - make sure to replace TEAM_ID, USER_ID, and CHANNEL_ID first
* - requires you have permissions to delete ofc
*/
TS.channels.addMsg = function e(t, n) {
/* begin message check and delete */
if (n.type == "message" && n.source_team_id == "TEAM_ID" && n.user == "USER_ID") {
TS.api.call("chat.delete", {_attempts: 0, _delay_ms: 100, channel: "CHANNEL_ID", ts: n.ts})
}
/* end message check and delete */