Skip to content

Commit

Permalink
Create stringsetup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
IVETRI authored Mar 18, 2021
1 parent 308dab7 commit a0cca8d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions stringsetup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env python3
# (c) https://t.me/TelethonChat/37677
# This Source Code Form is subject to the terms of the GNU
# General Public License, v.3.0. If a copy of the GPL was not distributed with this
# file, You can obtain one at https://www.gnu.org/licenses/gpl-3.0.en.html.

from telethon.sessions import StringSession
from telethon.sync import TelegramClient

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"""
)
APP_ID = int(input("Enter APP ID here: "))
API_HASH = input("Enter API HASH here: ")

with TelegramClient(StringSession(), APP_ID, API_HASH) as client:
print(client.session.save())
client.send_message("me", client.session.save())

0 comments on commit a0cca8d

Please sign in to comment.