From 25000abb125c03dd76e1c749c7562253d818f816 Mon Sep 17 00:00:00 2001 From: freeram Date: Thu, 7 Mar 2024 11:08:23 -0700 Subject: [PATCH] Add Rich Presence boilerplate --- pomodorodiscord/src/richpresence.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 pomodorodiscord/src/richpresence.py diff --git a/pomodorodiscord/src/richpresence.py b/pomodorodiscord/src/richpresence.py new file mode 100644 index 0000000..1c2e90d --- /dev/null +++ b/pomodorodiscord/src/richpresence.py @@ -0,0 +1,24 @@ +# Can only update every 15 seconds +import pypresence + +CLIENT_ID = '1215345125002059836' + + +class RichPresence(pypresence.Presence): + def __init__(self): + super().__init__(client_id=CLIENT_ID) + try: + self.connect() + self.default_state() + except Exception as e: + print(f"Failed to connect to Discord: {e}") + + def default_state(self): + self.update(state="Placeholder", + details="Placeholder details", large_image="tomato") + + def begin_pomodoro(self): + pass + + def begin_break(self): + pass