forked from PunyaAlby/ALBY-Userbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstring_session.py
25 lines (22 loc) · 1.11 KB
/
string_session.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
#!/usr/bin/env python3
# (c) https://t.me/TelethonChat/37677 and SpEcHiDe
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
from telethon.sync import TelegramClient
from telethon.sessions import StringSession
print("""Please go-to my.telegram.org
Login using your Telegram account
Click on API Development Tools
Create a new application, by entering the required details
Check your Telegram saved messages section to copy the STRING_SESSION""")
API_KEY = int(input("Enter API_KEY here: "))
API_HASH = input("Enter API_HASH here: ")
with TelegramClient(StringSession(), API_KEY, API_HASH) as client:
print("Check Telegram Save Message Mu Untuk Copy STRING_SESSION ")
session_string = client.session.save()
saved_messages_template = """😼 Thank u for Support Kyy-Userbot | Channel: @ahhsudahlahhh
<code>STRING_SESSION</code>: <code>{}</code>
⚠️ <i>Please be careful before passing this value to third parties</i>""".format(session_string)
client.send_message("me", saved_messages_template, parse_mode="html")