From 5ffa3bd8b3c7c4fc4d3e417c0f71b8da2687ccfb Mon Sep 17 00:00:00 2001 From: Benjamin G Carlisle Date: Sat, 6 Feb 2021 14:04:54 +0100 Subject: [PATCH] Added "replacethis" --- delete-this.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/delete-this.py b/delete-this.py index 6708ace..cf98568 100644 --- a/delete-this.py +++ b/delete-this.py @@ -17,4 +17,10 @@ for notif in notifications: print(notif["id"]) mastodon.notifications_dismiss(notif["id"]) mastodon.status_delete(id_to_delete) + if "!replacethis" in notif.status.content and notif.account.acct == "bgcarlisle@scholar.social": + id_to_delete = notif.get("status").get("in_reply_to_id") + print(notif["id"]) + mastodon.notifications_dismiss(notif["id"]) + mastodon.status_delete(id_to_delete) + os.system('python3 shantybot.py')