mirror of
https://github.com/TheCaduceus/FileStreamBot.git
synced 2026-01-15 08:23:28 -03:00
Bump to v1.2 (Fix Channels)
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user