Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the Doing Dpp's option #1

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions pwrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def rpcData():
"type": "list",
"name": "subject",
"message": "Select the subject you are studying: ",
"choices": ['Physics', 'Chemistry', 'Mathematics', 'Biology', 'Attempting Test']
"choices": ['Physics', 'Chemistry', 'Mathematics', 'Biology', 'Attempting Test',"Doing DPP's"]
},
{
"type": "input",
Expand All @@ -73,7 +73,13 @@ def rpcData():
}
]
data = prompt(dataIn, style=stylesheet)
return data['batch'], "test" if data['subject'].startswith("At") else data['subject'].lower(), data['topic']

if data['subject'].startswith("Attempting"):
return data['batch'], "test", data['topic']
if data['subject'].startswith("Doing"):
return data['batch'], "dpp", data['topic']
else:
return data['batch'],data['subject'].lower(), data['topic']

RPC = Presence(CLIENT_ID)
RPC.connect()
Expand All @@ -84,12 +90,23 @@ def update_presence():
RPC.clear()
except Exception:
RPC.connect() # This means that the connection already got disconnected, so attempt to start a new one

if data[1] == "test":
large_image="test"
large_text = "Attempting Test"
elif data[1] == "dpp":
large_image="test"
large_text = "Doing Dpp"
else:
large_image=data[1]
large_text = data[1].title()

RPC.update(
state=data[2].title(),
details=data[0].title(),
start=LOG_TIME,
large_image=data[1],
large_text="Attempting Test" if data[1] == "test" else data[1].title(),
large_image=large_image,
large_text=large_text,
small_image="pw",
small_text="Physics Wallah!",
buttons=[{"label": "Physics Wallah 💖", "url": "https://discord.gg/physicswallah"}, { "label": "PW Utils ⭐", "url": "https://github.com/FireHead90544/PWUtils"}]
Expand All @@ -109,3 +126,4 @@ def update_presence():
pass
print(f"{Fore.GREEN} >>> Closed Rich Presence :)")
break