Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.03 KB | None | 0 0
  1. import rpc
  2. import datetime
  3. import time
  4.  
  5. print("Demo for python-discord-rpc")
  6. client_id = 'id' #Your application's client ID as a string. (This isn't a real client ID)
  7. rpc_obj = rpc.DiscordIpcClient.for_platform(client_id) #Send the client ID to the rpc module
  8. print("RPC connection successful.")
  9.  
  10. time.sleep(5)
  11. start_time = time.time()
  12. birth = datetime.datetime(2019, 6, 23, 0, 0, 0, 0)
  13. print("Starting RPC")
  14. while True:
  15.     td = datetime.datetime.now()-birth
  16.     days, hours, minutes, seconds = td.days, td.seconds // 3600, td.seconds // 60 % 60, td.seconds % 60
  17.     activity = {
  18.             "details": "since " + str(days) + " days, " + str(hours) + " hours",
  19.             "state": "(In batcave we use arch btw)",
  20.             "assets": {
  21.                 #"small_text": "Text for small_image",
  22.                 #"small_image": "img_small",
  23.                 "large_text": "il est plus chou que toi hein",
  24.                 "large_image": "batpanda"
  25.                 },
  26.             }
  27.     rpc_obj.set_activity(activity)
  28.     time.sleep(60)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement