This commit is contained in:
levina 2021-11-14 18:48:41 +07:00 committed by GitHub
parent a94e43ad75
commit 2e2604975e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

24
main.py
View File

@ -1,15 +1,39 @@
import os
import asyncio
import logging
from pytgcalls import idle
from pyrogram import idle as pidle
from driver.veez import call_py, bot
if os.path.exists('log.txt'):
with open('log.txt', 'r+') as f:
f.truncate(0)
logging.basicConfig(
format='%(asctime)s | %(levelname)s | %(name)s | %(message)s',
datefmt="[%X]",
handlers=[
logging.FileHandler('log.txt'),
logging.StreamHandler()],
level=logging.INFO)
logging.getLogger("pyrogram").setLevel(logging.WARNING)
LOGGER = logging.getLogger(__name__)
async def mulai_bot():
print("[VEEZ]: STARTING BOT CLIENT")
await bot.start()
print("[VEEZ]: STARTING PYTGCALLS CLIENT")
await call_py.start()
await idle()
await pidle()
print("[VEEZ]: STOPPING BOT & USERBOT")
await bot.stop()
loop = asyncio.get_event_loop()
loop.run_until_complete(mulai_bot())
LOGGER.info("✅ bot has been started")