discord-rich-presence 1.1.0

Creator: bigcodingguy24

Last updated:

Add to Cart

Description:

discordrichpresence 1.1.0

discord-rich-presence
A lightweight and safe package for creating custom rich presences on Discord.
Example

How to Use
Making a Discord App

Create an app by clicking "New Application" in the Discord Developers Portal.
Give your app a name and an icon (this can be changed later). Make sure to save your changes.

Optional: Go to "Rich Presence", and add a few images under the "Rich Presence Assets" section.


Under "Application Id" in the "General Information" tab, copy your app's id.

Installation

Install the latest version of Python if you haven't already.
Run the following in your terminal:

$ pip install discord-rich-presence

If all goes well, it should say something like "Successfully installed discord-rich-presence".
Writing the Code

Create a file ending in .py, and paste in the following example from examples/simple.py:

from discordrp import Presence
import time

client_id = "000000000000000000" # Replace this with your own client id

with Presence(client_id) as presence:
print("Connected")
presence.set(
{
"state": "In Game",
"details": "Summoner's Rift",
"timestamps": {"start": int(time.time())},
}
)
print("Presence updated")

while True:
time.sleep(15)

Make sure you replace the client_id variable with your app's id that you copied earlier.

Run the program! You should now see that you have a rich presence on your profile that will be on until you stop the program! Feel free to change the code however you want by adding images, buttons, and more. Check out examples/complex.py for another example.

Troubleshooting
Here are the most common errors:

ActivityError: An incorrect dictionary was passed to Presence.set. Make sure that it matches the format expected by Discord.
ClientIDError: Verify that your client ID is valid.
PresenceError: Read the Discord docs for more information.
ConnectionRefusedError or FileNotFoundError: Make sure that your Discord application is open and logged in.
Program hangs for a long time and does not set the presence: Wait for at least 10 seconds before closing and trying again.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.