info/info.py
2022-08-06 10:49:37 +02:00

35 lines
601 B
Python

from mastobot import Mastobot
# main
if __name__ == '__main__':
bot = Mastobot()
notifications = bot.mastodon.notifications()
for notif in notifications:
if notif.type != 'mention':
print(f"Dismissing notification id {notif.id}")
bot.mastodon.notifications_dismiss(notif.id)
else:
mention = bot.get_data(notif)
if mention.reply:
bot.post(mention)
else:
print(f"Dismissing notification id {notif.id}")
bot.mastodon.notifications_dismiss(notif.id)