forked from TeamLionX/LionX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
79 lines (67 loc) · 2.18 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import time
import heroku3
from .Config import Config
from .funcs.logger import logging
from .funcs.session import lionub
from .sql_helper.globals import addgvar, delgvar, gvarstatus
__version__ = "1.0.1"
__license__ = "GNU Affero General Public License v3.0"
__author__ = "LionUserBot <https://github.com/MdNoor786/Lion-Z>"
__copyright__ = "Lion-Z Copyright (©️) 2020 - 2021 " + __author__
lionub.version = __version__
lionub.tgbot.version = __version__
LOGS = logging.getLogger("LionX")
bot = lionub
StartTime = time.time()
lionversion = "0.5"
if Config.UPSTREAM_REPO == "lion":
UPSTREAM_REPO_URL = "https://github.com/MdNoor786/Lion-Z"
else:
UPSTREAM_REPO_URL = Config.UPSTREAM_REPO
if Config.PRIVATE_GROUP_BOT_API_ID == 0:
if gvarstatus("PRIVATE_GROUP_BOT_API_ID") is None:
Config.BOTLOG = False
Config.BOTLOG_CHATID = "me"
else:
Config.BOTLOG_CHATID = int(gvarstatus("PRIVATE_GROUP_BOT_API_ID"))
Config.PRIVATE_GROUP_BOT_API_ID = int(gvarstatus("PRIVATE_GROUP_BOT_API_ID"))
Config.BOTLOG = True
else:
if str(Config.PRIVATE_GROUP_BOT_API_ID)[0] != "-":
Config.BOTLOG_CHATID = int("-" + str(Config.PRIVATE_GROUP_BOT_API_ID))
else:
Config.BOTLOG_CHATID = Config.PRIVATE_GROUP_BOT_API_ID
Config.BOTLOG = True
if Config.PM_LOGGER_GROUP_ID == 0:
if gvarstatus("PM_LOGGER_GROUP_ID") is None:
Config.PM_LOGGER_GROUP_ID = -100
else:
Config.PM_LOGGER_GROUP_ID = int(gvarstatus("PM_LOGGER_GROUP_ID"))
elif str(Config.PM_LOGGER_GROUP_ID)[0] != "-":
Config.PM_LOGGER_GROUP_ID = int("-" + str(Config.PM_LOGGER_GROUP_ID))
try:
if Config.HEROKU_API_KEY is not None or Config.HEROKU_APP_NAME is not None:
HEROKU_APP = heroku3.from_key(Config.HEROKU_API_KEY).apps()[
Config.HEROKU_APP_NAME
]
else:
HEROKU_APP = None
except Exception:
HEROKU_APP = None
# Global Configiables
COUNT_MSG = 0
USERS = {}
COUNT_PM = {}
LASTMSG = {}
CMD_HELP = {}
ISAFK = False
AFKREASON = None
CMD_LIST = {}
SUDO_LIST = {}
# for later purposes
INT_PLUG = ""
LOAD_PLUG = {}
# Variables
BOTLOG = Config.BOTLOG
BOTLOG_CHATID = Config.BOTLOG_CHATID
PM_LOGGER_GROUP_ID = Config.PM_LOGGER_GROUP_ID