-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
53 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from pypresence import Presence, ActivityType | ||
import time | ||
|
||
client_id = '717091213148160041' # Fake ID, put your real one here | ||
RPC = Presence(client_id) # Initialize the client class | ||
RPC.connect() # Start the handshake loop | ||
|
||
RPC.update( | ||
activity_type = ActivityType.LISTENING, # Set the activity to listening | ||
details=input("Your favorite song: "), | ||
state=input("The artist who made it: "), | ||
end=int(input("The length of the song (in seconds): ")) + time.time(), | ||
# At time of writing this, timestamps don't show for listening statuses! | ||
# ...so this field is pointless lol | ||
) # Get the user's favorite song! | ||
|
||
while True: # The presence will stay on as long as the program is running | ||
time.sleep(15) # Can only update rich presence every 15 seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import enum | ||
|
||
# https://discord.com/developers/docs/game-sdk/activities#data-models-activitytype-enum | ||
# ""type" must be one of 0, 2, 3, 5" -- Discord only implemented these four | ||
class ActivityType(enum.Enum): | ||
PLAYING = 0 | ||
#STREAMING = 1 | ||
LISTENING = 2 | ||
WATCHING = 3 | ||
#CUSTOM = 4 | ||
COMPETING = 5 |