forked from muhammedfurkan/UniBorg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
telesetup.py
33 lines (23 loc) · 858 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
32
33
#!/usr/bin/env python3
# (c) https://t.me/TelethonChat/37677
import os
import telethon
import telethon.sync
from telethon import TelegramClient, events
from telethon.tl import functions, types
from sample_config import Config, Development
# 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()