Bump to v1.2 (Fix Channels)

This commit is contained in:
Dr.Caduceus
2023-11-07 14:56:34 +05:30
committed by GitHub
4 changed files with 6 additions and 6 deletions

View File

@@ -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.<br>
[**Dr.Caduceus**](https://github.com/TheCaduceus): Owner & developer of File Stream Bot.

View File

@@ -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(

View File

@@ -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()

View File

@@ -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
return decorator