print to console when 50 limit is hit

pull/136/head
Aevann 2023-02-27 18:25:58 +02:00
parent 86b0d2f5c1
commit 2d9580c30c
1 changed files with 3 additions and 1 deletions

View File

@ -23,7 +23,9 @@ from .config.const import *
def media_ratelimit(v):
t = time.time() - 86400
count = g.db.query(Media).filter(Media.user_id == v.id, Media.created_utc > t).count()
if count > 50: abort(500)
if count > 50:
abort(500)
print(f'\n\n★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★\n\n@{v.username} hit the 50 files daily limit!\n\n★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★\n\n', flush=True)
def process_files(files, v, body):
if g.is_tor or not files.get("file"): return body