-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtelethon
More file actions
27 lines (20 loc) · 875 Bytes
/
telethon
File metadata and controls
27 lines (20 loc) · 875 Bytes
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
__author__ = "@StarkBots"
import os
try:
from telethon.sessions import StringSession
from telethon.sessions.string import StringSession
from telethon.sync import TelegramClient
except:
os.system("pip install telethon")
from telethon.sessions import StringSession
from telethon.sessions.string import StringSession
from telethon.sync import TelegramClient
def generate_telethon_session():
print("\nTelethon Session generator!\n")
APP_ID = int(input("\nEnter API ID here: "))
API_HASH = input("\nEnter API HASH here: ")
os.system("CLS||clear")
with TelegramClient(StringSession(), APP_ID, API_HASH) as StarkBots:
print("\nSession sent in saved messages.")
StarkBots.send_message("me", f"Don't share with anyone!\n\n`{StarkBots.session.save()}`\n\nJoin @StarkBots for more :)",)
generate_telethon_session()