video-stream/main.py

39 lines
918 B
Python
Raw Normal View History

2021-11-14 11:48:41 +00:00
import os
2021-10-29 18:47:52 +00:00
import asyncio
2021-11-14 11:48:41 +00:00
import logging
2021-10-29 18:47:52 +00:00
from pytgcalls import idle
2021-11-14 11:48:41 +00:00
from pyrogram import idle as pidle
2021-11-02 14:32:50 +00:00
from driver.veez import call_py, bot
2021-11-02 08:36:57 +00:00
2021-11-14 11:48:41 +00:00
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__)
2021-10-29 18:47:52 +00:00
async def mulai_bot():
2021-11-12 00:09:09 +00:00
print("[VEEZ]: STARTING BOT CLIENT")
2021-10-29 18:47:52 +00:00
await bot.start()
2021-11-12 00:09:09 +00:00
print("[VEEZ]: STARTING PYTGCALLS CLIENT")
2021-10-29 18:47:52 +00:00
await call_py.start()
await idle()
2021-11-14 11:48:41 +00:00
await pidle()
2021-11-12 00:09:09 +00:00
print("[VEEZ]: STOPPING BOT & USERBOT")
2021-10-29 18:47:52 +00:00
await bot.stop()
2021-10-29 20:19:54 +00:00
loop = asyncio.get_event_loop()
2021-10-29 18:47:52 +00:00
loop.run_until_complete(mulai_bot())
2021-11-14 11:48:41 +00:00
LOGGER.info("✅ bot has been started")