summaryrefslogtreecommitdiffstats
path: root/tele.py
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-03-08 10:02:46 +0100
committerGustav Sörnäs <gustav@sornas.net>2021-03-08 10:02:46 +0100
commit786485190e2e9373c707f8baa86fb4292f13b2fb (patch)
tree3064f12036136874116d3b21c9e8ef571378ea74 /tele.py
parent9ac04b24c14d1c0937a2aee5dac9e489d5ef2803 (diff)
downloadtg-786485190e2e9373c707f8baa86fb4292f13b2fb.tar.gz
refresh scr when receiving messages
Diffstat (limited to 'tele.py')
-rw-r--r--tele.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/tele.py b/tele.py
index 02ae72f..2dc3562 100644
--- a/tele.py
+++ b/tele.py
@@ -2,6 +2,7 @@ import aioconsole
import logging
import telethon
import credentials
+import cursed
logging.basicConfig(
format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s',
@@ -13,24 +14,7 @@ client = telethon.TelegramClient(
credentials.API_HASH
)
-
@client.on(telethon.events.NewMessage)
async def new_message(event):
messages.append(event.raw_text)
-
-
-
-async def send_lines(recipient):
- while True:
- line = await aioconsole.ainput()
- await client.send_message(recipient, line)
-
-
-async def main():
- await send_lines(recipient=input("Phone number to chat with: "))
-
-'''
-with client:
- client.start()
- client.loop.run_until_complete(main())
-'''
+ redraw(messages)