Skip to content

Instantly share code, notes, and snippets.

@kynex7510
Created March 15, 2021 21:09
Show Gist options
  • Save kynex7510/01895637e64a9b743b4d06c061a2c150 to your computer and use it in GitHub Desktop.
Save kynex7510/01895637e64a9b743b4d06c061a2c150 to your computer and use it in GitHub Desktop.
Discord Samsung Galaxy Rich Presence
import json
from urllib.request import Request,urlopen
#update: START, STOP, UPDATE
p = json.dumps({"package_name": "com.epicgames.fortnite", "update": "START"})
p = p.encode()
req = Request('https://discordapp.com/api/v6/presences', p)
req.add_header("Authorization", "your token")
req.add_header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0")
req.add_header("Content-Type", "application/json")
data = urlopen(req).read().decode()
print(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment