-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
__init__.py
43 lines (33 loc) · 1.07 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
#github.com/Vasusen-code
from pyrogram import Client
from telethon.sessions import StringSession
from telethon.sync import TelegramClient
from decouple import config
import logging, time, sys
logging.basicConfig(format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s',
level=logging.WARNING)
# variables
API_ID = config("API_ID", default=None, cast=int)
API_HASH = config("API_HASH", default=None)
BOT_TOKEN = config("BOT_TOKEN", default=None)
SESSION = config("SESSION", default=None)
FORCESUB = config("FORCESUB", default=None)
AUTH = config("AUTH", default=None, cast=int)
bot = TelegramClient('bot', API_ID, API_HASH).start(bot_token=BOT_TOKEN)
userbot = Client("saverestricted", session_string=SESSION, api_hash=API_HASH, api_id=API_ID)
try:
userbot.start()
except BaseException:
print("Userbot Error ! Have you added SESSION while deploying??")
sys.exit(1)
Bot = Client(
"SaveRestricted",
bot_token=BOT_TOKEN,
api_id=int(API_ID),
api_hash=API_HASH
)
try:
Bot.start()
except Exception as e:
print(e)
sys.exit(1)