diff --git a/main.py b/main.py index 6b5d240..fe64802 100644 --- a/main.py +++ b/main.py @@ -1,17 +1,19 @@ import asyncio + +from program import LOGS from pytgcalls import idle from driver.core import calls, bot, user async def start_bot(): await bot.start() - print("[INFO]: BOT & UBOT CLIENT STARTED !!") + LOGS.info("[INFO]: BOT & USERBOT CLIENT STARTED !!") await calls.start() - print("[INFO]: PY-TGCALLS CLIENT STARTED !!") + LOGS.info("[INFO]: PY-TGCALLS CLIENT STARTED !!") await user.join_chat("VeezSupportGroup") await user.join_chat("levinachannel") await idle() - print("[INFO]: STOPPING BOT & USERBOT") + LOGS.info("[INFO]: BOT & USERBOT STOPPED !!") await bot.stop() loop = asyncio.get_event_loop() diff --git a/program/__init__.py b/program/__init__.py index e46644b..19694be 100644 --- a/program/__init__.py +++ b/program/__init__.py @@ -1,3 +1,18 @@ __version__ = "0.6.5" +# >>> patch : F.11.22 -# update patch : F.11.22 +import time +import logging + +from driver.core import me_bot + +logging.basicConfig( + filename=f'streambot-logs-{me_bot.id}.txt', + level=logging.INFO, + format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' +) +logging.getLogger("yt_dlp").setLevel(logging.ERROR) +logging.getLogger("pyrogram").setLevel(logging.ERROR) +logging.getLogger("PyTgCalls").setLevel(logging.ERROR) + +LOGS = logging.getLogger(__name__) diff --git a/program/callback.py b/program/callback.py index bd49ac1..c750dbe 100644 --- a/program/callback.py +++ b/program/callback.py @@ -231,6 +231,7 @@ async def sudo_set(_, query: CallbackQuery): » /blocklist - show you the list of all blacklisted chat » /speedtest - run the bot server speedtest » /sysinfo - show the system information +» /logs - generate the current bot logs » /eval - execute any code (`developer stuff`) » /sh - run any command (`developer stuff`) diff --git a/program/sysinfo.py b/program/sysinfo.py index b86568c..f030153 100644 --- a/program/sysinfo.py +++ b/program/sysinfo.py @@ -17,6 +17,7 @@ along with this program. If not, see