thoughtsunificator / instagram-dm-unsender

Instagram userscript that enable batch unsending of DMs
MIT License
36 stars 3 forks source link

instagram-dm-unsender (idmu)

As of 2023 instagram.com doesn't allow batch unsending of messages which is why this project came to be.

The userscript allows a user to batch unsend DMs in a thread on the web version of instagram.com

⚠️ Only English is supported as of yet so please set your UI language to English before running the script.

⚠️ This might not work

Use cases

What's the difference between deleting and unsending?

Deleting a thread will only delete messages on your end but the other party will still be able to read your messages.

On the other hand, unsending of a thread will result in the deletion of messages on both ends, rendering the other party unable to read your messages.

How does it work / How can I use it?

This script is meant to be run on the page that lists the message threads.

The UI will only appear once you select a message thread :

UI Preview

From here on out, three buttons will be made available :

The workflow works as follow:

There is no concurrency. Messages are unsent one after the other by using a queue.

⚠️ Instagram has rate limits. After a certain number of messages, you might get blocked from unsending another message for a period of time.

Installing

Install a Userscript manager for your browser :

Finally, install the userscript from OpenUserJS :

Install latest stable release

Install development (master) version

Older releases

Development

I recommend using Violentmonkey or something similar and enabling userscript autoreloading as explained here : https://violentmonkey.github.io/posts/how-to-edit-scripts-with-your-favorite-editor/

Install dependencies:

To both serve and build with autoreloading:

This will also start an HTTP server and allow autoreloading of the userscript as changes are made.

You can also do a one-time build with:

The script will build to dist/idmu.user.js by default.

This might not work

Instagram web app is serving different UIs, probably based on the user location. Yours might not be supported

Link to the issue : https://github.com/thoughtsunificator/instagram-dm-unsender/issues/1

Testing

Use the DEBUG=idmu:test env to enable debug logs while testing.

Lint files:

Run test with ava:

Coverage:

TODO