Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Mar 31st, 2020 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ======
  2. run.py
  3. ======
  4. import logging, asyncio
  5. from userbot import *
  6. from ws_server import *
  7.  
  8. logging.basicConfig()
  9.  
  10. async def main():
  11.         await start_websockets_server()
  12.         await start_userbot()
  13.  
  14. asyncio.run(main())
  15.  
  16. ==========
  17. userbot.py
  18. ==========
  19. from telethon.sync import TelegramClient, events
  20. from telethon import types
  21.  
  22. USERS = {
  23.         'myuser' : {
  24.                 'id' : 'something',
  25.                 'hash' : 'something'
  26.         }
  27. }
  28.  
  29. AUTH_USER = 'myuser';
  30.  
  31. async def start_userbot():
  32.         async with TelegramClient(AUTH_USER, USERS[AUTH_USER]['id'], USERS[AUTH_USER]['hash']) as client:
  33.                 me = await client.get_me()
  34.                 MY_USERID = me.id
  35.                 print(MY_USERID)
  36.  
  37.         await client.run_until_disconnected()
  38.  
  39. ============
  40. ws_server.py
  41. ============
  42. import asyncio
  43.  
  44. async def start_websockets_server():
  45.         while True:
  46.                 print('test')
  47.                 await asyncio.sleep(2)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top