Add hash checking to TT downloading

This commit is contained in:
Roman Krček
2024-10-13 21:07:56 +02:00
parent 47248f10ab
commit 6d508121b0
3 changed files with 52 additions and 11 deletions

View File

@@ -7,12 +7,12 @@ from telegram_downloader_bot.settings import settings
def protected(func):
@wraps(func)
async def wrapper(client, message):
if int(message.from_user.id) not in allowed_ids:
if int(message.from_user.id) not in settings.allowed_ids_list:
log.warning(
f"User with ID {message.from_user.id} attempted"
"to text this bot!")
log.info(
f"Only users allowed are: {' '.join(allowed_ids)}")
f"Only users allowed are: {' '.join(settings.allowed_ids_list)}")
return await message.reply_text("You are not on the list!")
return await func(client, message)
return wrapper