-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.py
49 lines (41 loc) · 1.41 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
38
39
40
41
42
43
44
45
46
47
48
49
import config
import time
import logging
from pyrogram import Client, idle
from pyromod import listen
from pyrogram.errors import ApiIdInvalid, ApiIdPublishedFlood, AccessTokenInvalid
# Configure logging
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)
logging.getLogger("pymongo").setLevel(logging.ERROR)
# Initialize start time
StartTime = time.time()
# Initialize the Client
app = Client(
"Anonymous",
api_id=config.API_ID,
api_hash=config.API_HASH,
bot_token=config.BOT_TOKEN,
in_memory=True,
plugins=dict(root="StringGenBot"),
)
if __name__ == "__main__":
print("𝚂𝚝𝚛𝚒𝚗𝚐 𝚂𝚎𝚜𝚜𝚒𝚘𝚗 𝙶𝚎𝚗 𝚜𝚝𝚊𝚛𝚝𝚒𝚗𝚐...")
try:
app.start()
except ApiIdInvalid:
raise Exception("Your API_ID is not valid.")
except ApiIdPublishedFlood:
raise Exception("Your API_ID/API_HASH is flood banned.")
except AccessTokenInvalid:
raise Exception("Your BOT_TOKEN is not valid.")
except Exception as e:
logging.error(f"An unexpected error occurred: {e}")
raise
uname = app.get_me().username
print(f"@{uname} NOW STRING SESSION GEN IS READY TO GEN SESSION")
idle()
app.stop()
print("🇸 🇪 🇸 🇸 🇮 🇴 🇳 🇬 🇪 🇳 🇷 🇦 🇹 🇮 🇳 🇬 🇸 🇹 🇴 🇵 🇵 🇪 🇩...")