diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-03-11 16:57:06 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-03-11 16:57:06 +0100 |
| commit | 7569dc8aa6e9b9280b128c9f7aa3208239e34c87 (patch) | |
| tree | 7089d7280d8e5fa357bb37f6cf4e993300188400 | |
| parent | fa67e6987f1603811a0ab02180354aa56c2ab00e (diff) | |
| download | tg-7569dc8aa6e9b9280b128c9f7aa3208239e34c87.tar.gz | |
show client history
| -rw-r--r-- | TODO | 4 | ||||
| -rw-r--r-- | cursed.py | 5 | ||||
| -rw-r--r-- | main.py | 2 |
3 files changed, 6 insertions, 5 deletions
@@ -8,15 +8,13 @@ daily driver: - commands - tg chat - tg list -- show chat history - notifications - libnotify - silent messages - shift + enter to insert new line -- show sent/received -- show sending status (sending, sent, read) by updating icon later: +- show sending status (sending, sent, read) by updating icon - show someone is typing - support groupchats - configuration framework @@ -29,7 +29,10 @@ class Console(): self.stdscr.addstr(self.typed_message) self.stdscr.refresh() - async def start(self, on_str, on_tab): + async def start(self, client, on_str, on_tab): + async for message in client.iter_messages("+46763060644", limit=10): + self.messages.insert(0, Message(message.raw_text, message.id, " ")) + while True: self.redraw() char = await asyncio.to_thread(self.stdscr.get_wch) @@ -17,7 +17,7 @@ def main(): tele.redraw = lambda: c.redraw() with tele.client: tele.client.start() - tele.client.loop.run_until_complete(c.start(on_str, on_tab)) + tele.client.loop.run_until_complete(c.start(tele.client, on_str, on_tab)) if __name__=="__main__": |
