-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy path__main__.py
37 lines (29 loc) · 1.05 KB
/
__main__.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
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot start point """
from importlib import import_module
import os
from telethon.errors.rpcerrorlist import PhoneNumberInvalidError
from userbot import LOGS, bot
from userbot.modules import ALL_MODULES
INVALID_PH = '\nERROR: The Phone No. entered is INVALID' \
'\n Tip: Use Country Code along with No.' \
'\n Recheck your Phone Number'
try:
bot.start()
except PhoneNumberInvalidError:
print(INVALID_PH)
exit(1)
for module_name in ALL_MODULES:
imported_module = import_module("userbot.modules." + module_name)
LOGS.info("Your Bot is alive! Test it by typing .alive on any chat."
" Should you need assistance, head to https://t.me/userbot_support")
LOGS.info("Your Bot Version is 4.0")
SEM_TEST = os.environ.get("SEMAPHORE", None)
if SEM_TEST:
bot.disconnect()
else:
bot.run_until_disconnected()