forked from JaskaranSM/UniBorg
-
Notifications
You must be signed in to change notification settings - Fork 1
/
telesetup.py
31 lines (22 loc) · 844 Bytes
/
telesetup.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
#!/usr/bin/env python3
# (c) https://t.me/TelethonChat/37677
import telethon.sync
from telethon import TelegramClient, events
from telethon.tl import types, functions
import os
from config import Development as Config
# https://t.me/TelethonChat/13265
client = TelegramClient(input("Enter your username: @"), Config.APP_ID, Config.API_HASH).start()
def progress(current, total):
print("Downloaded: " + str(current) + " of " + str(total) + " Percent: " + str((current / total) * 100))
spechide = client.get_me()
print(spechide.stringify())
# client.send_message(spechide, "Dummy Message to get active session")
"""Interactive client to test various things
"""
if __name__ == "__main__":
"""@client.on(events.NewMessage)
def myeventhandler(event):
print(event.raw_text)"""
print("Loaded")
# client.run_until_disconnected()