This commit is contained in:
spla 2022-12-18 12:56:48 +01:00
pare 5bc8f95941
commit bd84443c3e

Veure arxiu

@ -35,13 +35,7 @@ if __name__ == '__main__':
for notif in notifications:
if notif.type != 'mention' and notif.type != 'status':
print(f"Dismissing notification id {notif.id}")
bot.mastodon.notifications_dismiss(notif.id)
elif notif.type == 'mention':
if notif.type == 'mention':
mention = bot.get_data(notif)
@ -149,38 +143,23 @@ if __name__ == '__main__':
bot.mastodon.status_post(f'@{mention.acct}, error al esborrar tots els tuts.', in_reply_to_id=mention.status_id, visibility='direct')
print(f"Dismissing notification id {mention.id}")
bot.mastodon.notifications_dismiss(mention.id)
else:
print(f"Dismissing notification id {mention.id}")
bot.mastodon.notifications_dismiss(mention.id)
elif notif.type == 'status':
if 'visibility' in notif.status:
if notif.status != None:
if notif.status.visibility == 'public' and notif.status.language == 'ca':
if 'visibility' in notif.status:
found_it, pending = db.check_user(notif.account.acct)
if notif.status.visibility == 'public' and notif.status.language == 'ca':
if found_it and not pending and notif.status.in_reply_to_account_id == None:
found_it, pending = db.check_user(notif.account.acct)
is_saved = db.save_post(notif.account.acct, unescape(cleanhtml(notif.status.content)))
if found_it and not pending and notif.status.in_reply_to_account_id == None:
print(f"Dismissing notification id {notif.id}")
is_saved = db.save_post(notif.account.acct, unescape(cleanhtml(notif.status.content)))
bot.mastodon.notifications_dismiss(notif.id)
print(f"Dismissing notification id {notif.id}")
else:
bot.mastodon.notifications_dismiss(notif.id)
else:
bot.mastodon.notifications_dismiss(notif.id)
bot.mastodon.notifications_dismiss(notif.id)
now = datetime.now()