__init__.py 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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)
  7. from pyrogram import Client
  8. import time
  9. import logging
  10. f = open("error.log", "w")
  11. f.write("PEAK OF LOG FILE")
  12. LOG_FORMAT = (
  13. '''
  14. [%(asctime)s.%(msecs)03d] %(filename)s:%(lineno)s
  15. %(levelname)s: %(message)s''')
  16. logging.basicConfig(
  17. level=logging.INFO,
  18. format=LOG_FORMAT,
  19. datefmt="%m-%d %H:%M",
  20. filename="error.log",
  21. filemode="w",
  22. )
  23. console = logging.StreamHandler()
  24. console.setLevel(logging.ERROR)
  25. formatter = logging.Formatter(LOG_FORMAT)
  26. console.setFormatter(formatter)
  27. logging.getLogger("").addHandler(console)
  28. log = logging.getLogger()
  29. SUDOERS = SUDO_USER_ID
  30. SUDOERS.append(OWNER_ID)
  31. MOD_LOAD = []
  32. MOD_NOLOAD = []
  33. bot_start_time = time.time()
  34. app = Client("wbb", bot_token=bot_token, api_id=api_id, api_hash=api_hash)