azils3 commited on
Commit
fe363c4
·
verified ·
1 Parent(s): cc1139c

Update info.py

Browse files
Files changed (1) hide show
  1. info.py +15 -12
info.py CHANGED
@@ -1,14 +1,22 @@
1
  import re, time
2
  from os import environ
3
- from Script import script
 
 
 
4
 
5
  id_pattern = re.compile(r'^.\d+$')
6
 
7
  def is_enabled(value, default):
8
- if value.strip().lower() in ["on", "true", "yes", "1", "enable", "y"]: return True
9
- elif value.strip().lower() in ["off", "false", "no", "0", "disable", "n"]: return False
10
- else: return default
11
-
 
 
 
 
 
12
 
13
  # PyroClient Setup
14
  API_ID = int(environ['API_ID'])
@@ -73,10 +81,5 @@ FILE_STORE_CHANNEL = [int(ch) for ch in (environ.get('FILE_STORE_CHANNEL', '')).
73
  MELCOW_NEW_USERS = is_enabled(environ.get('MELCOW_NEW_USERS', "True"), True)
74
  PROTECT_CONTENT = is_enabled(environ.get('PROTECT_CONTENT', "False"), False)
75
  PUBLIC_FILE_STORE = is_enabled(environ.get('PUBLIC_FILE_STORE', "True"), True)
76
- LOG_MSG = "{} Iꜱ Rᴇsᴛᴀʀᴛᴇᴅ....✨\n\n🗓️ Dᴀᴛᴇ : {}\n⏰ Tɪᴍᴇ : {}\n\n🖥️ Rᴇᴏᴩ: {}\n🉐 Vᴇʀsɪᴏɴ: {}\n🧾 Lɪᴄᴇɴꜱᴇ: {}\n©️ Cᴏᴩʏʀɪɢʜᴛ: {}"
77
-
78
-
79
-
80
-
81
-
82
-
 
1
  import re, time
2
  from os import environ
3
+ from Script import script
4
+
5
+ logger = logging.getLogger(__name__)
6
+ logger.info("Loading configuration from info.py...")
7
 
8
  id_pattern = re.compile(r'^.\d+$')
9
 
10
  def is_enabled(value, default):
11
+ if value.strip().lower() in ["on", "true", "yes", "1", "enable", "y"]:
12
+ logger.debug(f"Value {value} is enabled.")
13
+ return True
14
+ elif value.strip().lower() in ["off", "false", "no", "0", "disable", "n"]:
15
+ logger.debug(f"Value {value} is disabled.")
16
+ return False
17
+ else:
18
+ logger.debug(f"Value {value} defaults to {default}.")
19
+ return default
20
 
21
  # PyroClient Setup
22
  API_ID = int(environ['API_ID'])
 
81
  MELCOW_NEW_USERS = is_enabled(environ.get('MELCOW_NEW_USERS', "True"), True)
82
  PROTECT_CONTENT = is_enabled(environ.get('PROTECT_CONTENT', "False"), False)
83
  PUBLIC_FILE_STORE = is_enabled(environ.get('PUBLIC_FILE_STORE', "True"), True)
84
+ LOG_MSG = "{} Iꜱ Rᴇꜱᴛᴀʀᴛᴇᴅ....✨\n\n🗓️ Dᴀᴛᴇ : {}\n⏰ Tɪᴍᴇ : {}\n\n🖥️ Rᴇᴏᴩ: {}\n🉐 Vᴇʀꜱɪᴏɴ: {}\n🧾 Lɪᴄᴇɴꜱᴇ: {}\n©️ Cᴏᴩʏʀɪɢʜᴛ: {}"
85
+ logger.info("Configuration loaded successfully.")