__init__.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. from config import (
  2. bot_token, api_id, api_hash, OWNER_ID,
  3. sudo_users_id as SUDO_USER_ID, log_group_id as LOG_GROUP_ID,
  4. fernet_encryption_key as FERNET_ENCRYPTION_KEY,
  5. captcha_delay_in_seconds as WELCOME_DELAY_KICK_SEC,
  6. ARQ_API_BASE_URL as ARQ_API)
  7. from pyrogram import Client
  8. from Python_ARQ import ARQ
  9. import time
  10. import logging
  11. f = open("error.log", "w")
  12. f.write("PEAK OF LOG FILE")
  13. LOG_FORMAT = (
  14. '''
  15. [%(asctime)s.%(msecs)03d] %(filename)s:%(lineno)s
  16. %(levelname)s: %(message)s''')
  17. logging.basicConfig(
  18. level=logging.INFO,
  19. format=LOG_FORMAT,
  20. datefmt="%m-%d %H:%M",
  21. filename="error.log",
  22. filemode="w",
  23. )
  24. console = logging.StreamHandler()
  25. console.setLevel(logging.ERROR)
  26. formatter = logging.Formatter(LOG_FORMAT)
  27. console.setFormatter(formatter)
  28. logging.getLogger("").addHandler(console)
  29. log = logging.getLogger()
  30. SUDOERS = SUDO_USER_ID
  31. SUDOERS.append(OWNER_ID)
  32. MOD_LOAD = []
  33. MOD_NOLOAD = []
  34. bot_start_time = time.time()
  35. app = Client("wbb", bot_token=bot_token, api_id=api_id, api_hash=api_hash)
  36. arq = ARQ(ARQ_API)