-
-
Save kiki67100/6c68436766ea3a037508970999b7e89e to your computer and use it in GitHub Desktop.
/* | |
This version is probably out of date, look at the dsci4-hacks ( Thanks to him x) ) instead: | |
*** not tested *** | |
https://github.com/dsci4-hacks/Delete-Teams-Messages/blob/main/delete_my_teams_messages.js | |
Thank you for all your contributions in comments | |
**** Original **** | |
By kiki67100 https://gist.github.com/kiki67100 | |
Tested on Google Chrome | |
Open Microsoft teams web version, select a conversation | |
Open Developper tools and copy / paste (Change YOUR_NAME by your) | |
Work on March 2020 maybe no work on the future... | |
*/ | |
window.id = []; | |
YOUR_NAME = "YOUR_NAME"; | |
window.idx=0; | |
setInterval(function() { | |
jQuery('#page-content-wrapper').find('div[id^=m]').each(function() { | |
$('virtual-repeat').scrollTop(0); | |
setTimeout(function(_this) { | |
//console.log('timeout...'); | |
//console.log('_this = ',_this); | |
txt = $(_this).text(); | |
if (txt.indexOf(YOUR_NAME) != -1) { | |
console.log('not inside'); | |
$(_this).css({ | |
'outline': '1px solid red' | |
}); | |
_id = $(_this).attr('id'); | |
//console.log('_this id =' + _id) | |
if (window.id.indexOf(_id) == -1) { | |
window.id.push(_id.substr(1)); | |
//console.log('add'); | |
} else { | |
//console.log('!!'); | |
} | |
}else{ | |
//console.log('already inside'); | |
} | |
}, 1000, this); | |
}); | |
}, 2000); | |
/* | |
- Extract messages id | |
On Google Chrome developper tools : | |
copy(id.join("\n")) | |
Delete a message, copy the ajax request and export as CURL (bash) (on network tools maybe end by "softDelete") | |
On notepad ++ on replace regex mode | |
REPLACE (.*) | |
Your CURL shell command find the id curl 'https://emea.[...]/121545326566?behavior=softDelete by $1 like this 'https://emea.[...]/$1?behavior=softDelete | |
lauch on linux terminal all lines | |
*/ |
Here is an updated working version of the script as of 17/07/2023:
https://github.com/dsci4-hacks/Delete-Teams-Messages/blob/main/delete_my_teams_messages.js
Hello everyone.
Script does not work with New Teams. The option to go back to Old Teams is not available anymore. Can the experts revise the code to work with New Teams?
Regards!
Hello
I'm quitting in 2 months, guys, I need you :D
Yeah, i am also kinda desparate ๐
Yeah, i am also kinda desparate ๐
I have made a new version - you can test it https://github.com/dsci4-hacks/Delete-Teams-Messages-Batch-Bulk-Delete/blob/main/Delete_Teams_Messages_v2.0
Hello
I'm quitting in 2 months, guys, I need you :D
I have made a new version - you can test it https://github.com/dsci4-hacks/Delete-Teams-Messages-Batch-Bulk-Delete/blob/main/Delete_Teams_Messages_v2.0
Hello everyone. Script does not work with New Teams. The option to go back to Old Teams is not available anymore. Can the experts revise the code to work with New Teams? Regards!
I have made a new version - you can test it https://github.com/dsci4-hacks/Delete-Teams-Messages-Batch-Bulk-Delete/blob/main/Delete_Teams_Messages_v2.0
I have made a new version - you can test it https://github.com/dsci4-hacks/Delete-Teams-Messages-Batch-Bulk-Delete/blob/main/Delete_Teams_Messages_v2.0
hello @dsci4-hacks . Tested on chrome, firefox and edge and got this error "[Automation Script] Error processing message ID: xxx"
can someone test to confirm? regards
anyone?!?!!? everybody sleeping????????
Script stopped working and shows errors
Uncaught TypeError: Cannot read properties of undefined (reading 'ownerDocument')
and TypeError: Cannot read properties of undefined (reading 'ownerDocument')