Closed B3ni15 closed 5 months ago
Hello!
Make sure that you upload your assets to the Rich Presence section of your app in the Discord Developer Portal.
Then, use the following template, replacing the large image key
and small image key
values with the names of your images.
with Presence(client_id) as presence:
print("Connected")
presence.set(
{
"state": "state",
"details": "details",
"timestamps": {"start": int(time.time())},
"assets": {
"large_image": "large image key", # Replace this with the key of one of your assets
"large_text": "large text hover", # Will show up when a user hovers over the image
"small_image": "small image key", # Replace this with the key of one of your assets
"small_text": "small text hover", # Will show up when a user hovers over the image
},
"buttons": [
{
"label": "label 1",
"url": "https://example.com",
},
{
"label": "label 2",
"url": "https://example.com",
},
],
}
)
print("Presence updated")
while True:
time.sleep(15)
Hope this helps! Let me know if you have any more questions.
Hello! How can i add buttons and images?
This is my code now: