Browse Source

Added deleter

main
Benjamin G Carlisle 5 years ago
parent
commit
506a3dc45f
  1. 20
      delete-this.py

20
delete-this.py

@ -0,0 +1,20 @@
from mastodon import Mastodon
mastodon = Mastodon(
access_token = 'shantybot_usercred.secret',
api_base_url = 'https://botsin.space'
)
notifications = mastodon.notifications()
for notif in notifications:
if notif.type == "mention":
print(notif["id"])
print(notif.status.content)
print(notif.account.acct)
if "!deletethis" 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)
Loading…
Cancel
Save