Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import rpc
- import datetime
- import time
- print("Demo for python-discord-rpc")
- client_id = 'id' #Your application's client ID as a string. (This isn't a real client ID)
- rpc_obj = rpc.DiscordIpcClient.for_platform(client_id) #Send the client ID to the rpc module
- print("RPC connection successful.")
- time.sleep(5)
- start_time = time.time()
- birth = datetime.datetime(2019, 6, 23, 0, 0, 0, 0)
- print("Starting RPC")
- while True:
- td = datetime.datetime.now()-birth
- days, hours, minutes, seconds = td.days, td.seconds // 3600, td.seconds // 60 % 60, td.seconds % 60
- activity = {
- "details": "since " + str(days) + " days, " + str(hours) + " hours",
- "state": "(In batcave we use arch btw)",
- "assets": {
- #"small_text": "Text for small_image",
- #"small_image": "img_small",
- "large_text": "il est plus chou que toi hein",
- "large_image": "batpanda"
- },
- }
- rpc_obj.set_activity(activity)
- time.sleep(60)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement