diff --git a/README.md b/README.md index fd6fc19..a7a79f9 100644 --- a/README.md +++ b/README.md @@ -112,4 +112,4 @@ docker run -p 8080:8080 file-stream-bot ## ❤️ Credits & Thanks -[**Dr.Caduceus**](https://github.com/TheCaduceus): Owner & developer of Microsoft E5 Auto Renewal Tool.
\ No newline at end of file +[**Dr.Caduceus**](https://github.com/TheCaduceus): Owner & developer of File Stream Bot. diff --git a/bot/__init__.py b/bot/__init__.py index 44289e0..0a12eec 100644 --- a/bot/__init__.py +++ b/bot/__init__.py @@ -5,7 +5,7 @@ from .config import Telegram, LOGGER_CONFIG_JSON dictConfig(LOGGER_CONFIG_JSON) -version = 1.1 +version = 1.2 logger = getLogger('bot') TelegramBot = Client( diff --git a/bot/config.py b/bot/config.py index 8ce66d7..63a86ce 100644 --- a/bot/config.py +++ b/bot/config.py @@ -1,7 +1,7 @@ from os import environ as env class Telegram: - API_ID = env.get("TELEGRAM_API_ID", 1234) + API_ID = int(env.get("TELEGRAM_API_ID", 1234)) API_HASH = env.get("TELEGRAM_API_HASH", "xyz") OWNER_ID = int(env.get("OWNER_ID", 1234567890)) ALLOWED_USER_IDS = env.get("ALLOWED_USER_IDS", "").split() diff --git a/bot/modules/decorators.py b/bot/modules/decorators.py index 0a7d17f..3c24daa 100644 --- a/bot/modules/decorators.py +++ b/bot/modules/decorators.py @@ -8,9 +8,9 @@ def verify_user(func: Callable): @wraps(func) async def decorator(client: Client, update: Union[Message, CallbackQuery]): - user_id = str(update.from_user.id) + chat_id = str(update.from_user.id if update.from_user else update.chat.id) - if not Telegram.ALLOWED_USER_IDS or user_id in Telegram.ALLOWED_USER_IDS: + if not Telegram.ALLOWED_USER_IDS or chat_id in Telegram.ALLOWED_USER_IDS: return await func(client, update) - return decorator \ No newline at end of file + return decorator