Experimental Discord Mobile Rich Presence (Android)
It's pretty simple.
- Connect to the Discord Gateway as a normal Discord Client.
- Send Identify and Update Presence.
MRPC now supports setting custom image through 2 links:
https://media.discordapp.net
(resolves frommp:path/to/image
)https://cdn.discordapp.com
(resolves from../../path/to/image
)
In late 2021(?), Discord allowed activity to specify media proxy image, which opens a way to set custom image. However, there is another trick that has not been used before:
- By default, Discord parses the input as
application_assets
(unless it is set to media proxy withmp:
prefix) - Setting the asset object to
test
results inhttps://cdn.discordapp.com/app-assets/application-id/test.png
- It does not verify anything there. This way, we can put
../..
to escape the path, then we can set anything such as an animated emoji right here, finally#
at the end to exclude.png
. - Setting the asset object to
../../emojis/emoji-id.gif#
results inhttps://cdn.discordapp.com/app-assets/application-id/../../emojis/emoji-id.gif#.png
which then gets resolved tohttps://cdn.discordapp.com/emojis/emoji-id.gif
- MRPC parses the image link automatically, so you just need to paste the link and it will work out of the box. You can only use image link from domains listed above.
- Rate limiting is not yet handled.
- This app uses the Discord Gateway instead of OAuth2 API (which I can't even find the documentation for the
activities.write
scope), so this might not be safe. Use this at your own risk. - Zlib compression is not yet used, due to the current using library doesn't correctly handle it(?).