grant "Hole Neglector" badge automatically

master
Aevann1 2022-08-24 22:26:41 +02:00
parent 3a2a399d93
commit 69903bb94b
1 changed files with 8 additions and 0 deletions

View File

@ -62,6 +62,14 @@ def sub_inactive_purge_task():
send_repeatable_notification(x.user_id, f":marseyrave: /h/{x.sub} has been deleted for inactivity after one week without new posts. All posts in it have been moved to the main feed :marseyrave:") send_repeatable_notification(x.user_id, f":marseyrave: /h/{x.sub} has been deleted for inactivity after one week without new posts. All posts in it have been moved to the main feed :marseyrave:")
for name in names: for name in names:
first_mod_id = g.db.query(Mod.user_id).filter(sub=name).order_by(Mod.created_utc).first()[0]
first_mod = get_account(first_mod_id)
badge_grant(
user=first_mod,
badge_id=156,
description=f'Brought a Hole into this world, only to let it die (/h/{name})'
)
for admin in admins: for admin in admins:
send_repeatable_notification(admin, f":marseyrave: /h/{name} has been deleted for inactivity after one week without new posts. All posts in it have been moved to the main feed :marseyrave:") send_repeatable_notification(admin, f":marseyrave: /h/{name} has been deleted for inactivity after one week without new posts. All posts in it have been moved to the main feed :marseyrave:")