forked from PolisanTheEasyNick/Telegram-UserBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_string_session.py
More file actions
22 lines (18 loc) · 922 Bytes
/
Copy pathgenerate_string_session.py
File metadata and controls
22 lines (18 loc) · 922 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Copyright (C) 2020 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
# This script won't run Paperplane, it just generates a session.
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 and create a new application, by entering the required details.
Get the 'App api_id' and 'App api_hash'.
API_KEY is api_id and API_HASH is api_hash. Write them down below when prompted.""")
API_KEY = input("API_KEY: ")
API_HASH = input("API_HASH: ")
with TelegramClient(StringSession(), API_KEY, API_HASH) as client:
print("This is your string session, be careful with it and don't share it with anyone else!")
print("")
print(client.session.save())