-
Notifications
You must be signed in to change notification settings - Fork 563
Expand file tree
/
Copy pathshared_client.py
More file actions
28 lines (24 loc) · 1.04 KB
/
shared_client.py
File metadata and controls
28 lines (24 loc) · 1.04 KB
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
# Copyright (c) 2025 devgagan : https://github.com/devgaganin.
# Licensed under the GNU General Public License v3.0.
# See LICENSE file in the repository root for full license text.
from telethon import TelegramClient
from config import API_ID, API_HASH, BOT_TOKEN, STRING
from pyrogram import Client
import sys
client = TelegramClient("telethonbot", API_ID, API_HASH)
app = Client("pyrogrambot", api_id=API_ID, api_hash=API_HASH, bot_token=BOT_TOKEN)
userbot = Client("4gbbot", api_id=API_ID, api_hash=API_HASH, session_string=STRING)
async def start_client():
if not client.is_connected():
await client.start(bot_token=BOT_TOKEN)
print("SpyLib started...")
if STRING:
try:
await userbot.start()
print("Userbot started...")
except Exception as e:
print(f"Hey honey!! check your premium string session, it may be invalid of expire {e}")
sys.exit(1)
await app.start()
print("Pyro App Started...")
return client, app, userbot