dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
680 stars 161 forks source link

Unable to have buttons in status + images don't work #433

Closed KDot227 closed 1 year ago

KDot227 commented 1 year ago

Summary

The Docs say that your able to have buttons in the custom rich presence but it is not working for me

Reproduction Steps

run following code

Code

buttons = {'label': 'test', 'url': 'https://sped.lol'}
clientid = 1045893665979105340
name = "Godfather"
details = "naw"
state = "Godfather Selfbot"
imagekey = "kdot"
st = time.time()
buttons = [{'label': 'test', 'url': 'https://sped.lol'}]
activ = discord.Activity(type=discord.ActivityType.playing, buttons=buttons, application_id=clientid, name=name, details=details, state=state, assets={'large_image': 'kdot', 'large_text': 'Godfather Selfbot'}, timestamps={'start':st})
await kdot.change_presence(status=discord.Status.dnd, activity=activ)

Expected Results

Rich presence with very nice button or buttons + large image

Actual Results

no error, no buttons and no images

System Information

- Python v3.10.9-final
- discord.py-self v1.9.2-final
- aiohttp v3.7.4.post0
- system info: Windows 10 10.0.22621

Checklist

Additional Information

No response

KDot227 commented 1 year ago

picture of status = image

KDot227 commented 1 year ago

@dolfies

ahihiyou20 commented 1 year ago

@KDot227 Well actually you need to enter the ID of the asset, not it's name. You can get your asset ID from this url:

https://discordapp.com/api/oauth2/applications/[Your application ID]/assets

Then search for the asset you want then copy it's ID and fill it into "large_image" key as string

Also, I can confirm that the button is not working for me too.

KDot227 commented 1 year ago

@KDot227 Well actually you need to enter the ID of the asset, not it's name. You can get your asset ID from this url:

https://discordapp.com/api/oauth2/applications/[Your application ID]/assets

Then search for the asset you want then copy it's ID and fill it into "large_image" key as string

Also, I can confirm that the button is not working for me too.

Isn’t clientid and application id the same thing? Everything I’m trying right now seems to work with other applications such as py presence, etc

ahihiyou20 commented 1 year ago

@KDot227 well yes they're the same, maybe other libraries uses the asset's name but for discord.py-self. It uses the ID of the asset. Give it a try, I got it working after changing the name to the ID

KDot227 commented 1 year ago

@KDot227 well yes they're the same, maybe other libraries uses the asset's name but for discord.py-self. It uses the ID of the asset. Give it a try, I got it working after changing the name to the ID

I’m on vacation for a few more days but when I’m back I’ll try it. Thank you

ahihiyou20 commented 1 year ago

@KDot227 I've just found out that discord.py-self 1.9.2, which is installed on Pypi, doesn't support buttons Screenshot_20230109-215653_Termux.jpg As you can see, the source code has no attribute named "buttons", the comment also doesn't include any info about buttons

KDot227 commented 1 year ago

@KDot227 I've just found out that discord.py-self 1.9.2, which is installed on Pypi, doesn't support buttons Screenshot_20230109-215653_Termux.jpg As you can see, the source code has no attribute named "buttons", the comment also doesn't include any info about buttons

Weird that the documentation would include it then. Thank you for all the help though

dolfies commented 1 year ago

Sorry for the late reply.

Presence is better supported in the alpha (installed from master), and the alpha is what the docs document. Presence is getting a rework soon (I know I keep saying this but really, soon:tm:).

Over on the feat/billing/store/shit branch I'm working on stuff like getting application assets, and it's complete (just waiting on documentation and testing to be merged into master) if you want to try it out.

Also this is a dupe of #274