import cursed import asyncio import tele async def on_str(s): await tele.client.send_message("+46763060644", s) async def on_tab(): print("tab") def main(): messages = [] with cursed.Console() as c: def redraw(messages): cursed.redraw(c.stdscr, messages) tele.messages = messages tele.redraw = redraw with tele.client: tele.client.start() tele.client.loop.run_until_complete(cursed.start(c, on_str, on_tab, messages)) if __name__=="__main__": main()