none
This commit is contained in:
parent
a94e43ad75
commit
2e2604975e
24
main.py
24
main.py
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user