Skip to content

Commit 8c4e085

Browse files
committed
fix common misconception about having to connect client first
1 parent 402bb42 commit 8c4e085

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pypresence/baseclient.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ def send_data(self, op: int, payload: Union[dict, Payload]):
113113
if isinstance(payload, Payload):
114114
payload = payload.data
115115
payload = json.dumps(payload)
116+
117+
assert self.sock_writer is not None, "You must connect your client before sending events!"
118+
116119
self.sock_writer.write(
117120
struct.pack(
118121
'<II',

0 commit comments

Comments
 (0)