LennyPhoenix / py-discord-sdk

Discord Game SDK for Python
MIT License
26 stars 7 forks source link

Update Small Image and Large Image Activity Manager #10

Closed ParthJadhav closed 2 years ago

ParthJadhav commented 2 years ago

I tried using :-

ActivityAssets.LargeImage = "rpcimg

where 'rpcimg' is the name of image I uploaded on Discord Developer Portal.

It worked with https://github.com/qwertyquerty/pypresence . But since Discord-RPC, has been deprecated in favor of new Discord GameSDK. I wanted to use this repo.

Any help is appreciated.

LennyPhoenix commented 2 years ago

How are you setting the activity state? Your code should look something like this:

import discordsdk as dsdk

APPLICATION_ID =  # Insert your application ID here

app = dsdk.Discord(APPLICATION_ID, dsdk.CreateFlags.default)
activity_manager = app.get_activity_manager()

activity = dsdk.Activity()
activity.state = "Activity State Here"
activity.assets.large_image = "Large Image Name Here"

while True:
    time.sleep(1/60)  # Minor delay to give the program some rest time
    app.run_callbacks()
ParthJadhav commented 2 years ago

Thank you @LennyPhoenix . It works now :)