You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
601 B
36 lines
601 B
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)
|
|
|
|
|
|
|
|
|