+
     h  c                   s    ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHtH	t	 ^RI
5 ^RIHt ^RIHtHt  ! R R4      tR# )i    N)UnionOptional)Z*)Payload)get_ipc_pathget_event_loopc                   sz   a  ] tR t^t o V 3R lR ltR tV 3R lR ltV 3R lR ltR tV 3R	 lR
 lt	R t
RtV tR# )
BaseClientc                    < V ^8  d   QhRS[ /# )   	client_id)strZformat__classdict__   ":/usr/lib/python3.14/site-packages/pypresence/baseclient.py__annotate__BaseClient.__annotate__   s     +$ +$# +$    c                s   VP                  R R4      pVP                  RR4      pVP                  RR4      V n        VP                  RR4      V n        VP                  R^4      V n        VP                  R^
4      V n        \        V4      pVe   V P                  V4       MV P                  \        4       4       RV n        RV n	        Wn
        Ve   \        P                  ! V4      '       g   \        R4      h\        P                  ! V4      P                  pV^ ,          R	8X  d
   VR
,          p\!        V4      ^8w  d   \        R4      hV P                  '       d7   \        P"                  ! V4      '       g   \%        RRR4      hV P&                  pMV P(                  pVP+                  V4       W@n        \/        V RR4      '       d
   RV n        R# RV n        R# )loopNhandlerpipeisasyncFconnection_timeoutresponse_timeoutz!Error handler must be a function.self:i   NNz/Error handler should only accept two arguments.Z	CoroutineZ
SubroutinezDYou are running async mode - your error handler should be awaitable.on_eventT)Zgetr   r   r   r   r	   update_event_loopr   sock_readersock_writerr   inspectZ
isfunctionZPyPresenceExceptionZgetfullargspecargsleniscoroutinefunctionZInvalidArgument_async_err_handle_err_handleZset_exception_handlerr   Zgetattr
_events_on)r   r   Zkwargsr   r   r   Zerr_handlers   &&,    r   __init__ZBaseClient.__init__   s   zz&$'**Y-JJvt,	zz)U3"(**-A2"F &

+=r B	N	""4("">#34;?;?"%%g..)*MNN))'277DAw& Bx4yA~)*[\\|||227;;)+| Fo p p"44"..&&{3"L4T**"DO#DOr   c                sR    Wn         \        P                  ! V P                   4       R # N)r   asyncioZset_event_loop)r   r   s   &&r   r   ZBaseClient.update_event_loop?   s    	tyy)r   c                r   r   contextdictr
   r   r   r   r   D   s     , , ,r   c                s    V P                  VR ,          VR,          4      p\        P                  ! V P                   4      '       d   VP                  V4       R# R# Z	exceptionZfutureN)r   r   r   Zrun_until_complete)r   r   r'   Zresults   &&& r   r!   ZBaseClient._err_handleD   sD    gk2GH4EF&&t||44##F+ 5r   c                r   r&   r(   r
   r   r   r   r   J   s     D DT Dr   c                sb   "   V P                  VR ,          VR,          4      G Rj  xL
  R#  L5ir*   )r   )r   r   r'      &&&r   r    ZBaseClient._async_err_handleJ   s#     ll7;/1BCCCs   $/-/c                sv  "    \         P                  ! V P                  P                  ^4      V P                  4      G Rj  xL
 p\
        P                  ! RVR,          4      w  r#\         P                  ! V P                  P                  V4      V P                  4      G Rj  xL
 p\        P                  ! TP                  R4      4      pTR,          R8X  d   \        TR,          R,          4      hT#  L LT  \        \
        P                  3 d    \        h\         P                   d    \        hi ; i5i)	   N<II:Nr,   Nutf-8ZevtZERRORdatamessage)r%   wait_forr   readr   structunpackZBrokenPipeErrorZerrorZ
PipeClosedTimeoutErrorZResponseTimeoutjsonloadsZdecodeZServerError)r   preambleZstatus_codelengthr/   payloads   &     r   read_outputZBaseClient.read_outputM   s     	"$--d.>.>.C.CA.FH]H]^^H"(--x|"DK ))$*:*:*?*?*GI^I^__D
 **T[[125>W$gfoi899 __. 	## 	"!!	"sH   D9=C: C6A!C: #C8$C: (AD96C: 8C: :3D6.D66D9c                s<   < V ^8  d   QhRS[ RS[S[S[3,          /# )r   opr:   )Zintr    r)   r   r
   r   r   r   r   [   s$     % %C %%g*> %r   c           	     s@   \        V\        4      '       d   VP                  p\        P                  ! V4      pV P
                  f   Q R4       hV P
                  P                  \        P                  ! RV\        V4      4      VP                  R4      ,           4       R # )Nz3You must connect your client before sending events!r-   r.   )Z
isinstancer   r/   r6   Zdumpsr   Zwriter3   Zpackr   Zencode)r   r<   r:   r+   r   	send_dataZBaseClient.send_data[   s~    gw''llG**W%+b-bb+KKG NN7#	$	%r   c                s8  a"   \        V P                  4      pV'       g   \        h \        P                  R 8X  g   \        P                  R8X  dL   \
        P                  ! \
        P                  ! V4      V P                  4      G Rj  xL
 w  V n	        V n
        M\        P                  R8X  g   \        P                  R8X  d   \
        P                  ! V P                  R7      V n	        \
        P                  ! V P                  V P                  R7      o\
        P                  ! V P                  P                  V3R lV4      V P                  4      G Rj  xL
 w  V n
        pV P'                  ^ R^RV P(                  /4       V P                  P+                  ^4      G Rj  xL
 p\,        P.                  ! R	V4      w  rE\0        P2                  ! V P                  P+                  V4      G Rj  xL
 4      pR
V9   d/   VR,          R8X  d   \4        h\7        VR
,          VR,          4      hV P8                  '       d   V P:                  V P                  n        R# R#  EL EL	  \         d    \         h\
        P"                   d    \$        hi ; i L L5i)ZlinuxZdarwinNZwin32Zwin64)r   c                  s   < S # r$    )reader_protocols   r   Z<lambda>Z&BaseClient.handshake.<locals>.<lambda>t   s    fur   Zvr   z<iicoder0   zInvalid Client ID)r   r   ZDiscordNotFoundsysZplatformr%   r1   Zopen_unix_connectionr   r   r   ZStreamReaderr   ZStreamReaderProtocolZcreate_pipe_connectionZFileNotFoundErrorZInvalidPiper5   ZConnectionTimeoutr=   r   r2   r3   r4   r6   r7   Z	InvalidIDZDiscordErrorr"   r   Z	feed_data)r   Zipc_pathZ_r8   r@   r9   r/   r?   s   &      @r   	handshakeZBaseClient.handshakei   s    		*!!
	$||w&#,,(*B;B;K;KGLhLhiqLrtx  uL  uL  <M  6M2 $"2(CLLG,C#*#7#7TYY#G ")">">t?O?OVZV_V_"`,3,<,<TYY=]=]^uw  >A  CG  CZ  CZ  -[  '[# ! 	q3;?@))..q11}}UH5zz 0 0 5 5f ==>T>I"55tF|T)_==???)-D& % 6M '[  	## 	$##	$ 2=sz   $JA"I' 
I!I' JB>I' I$I' (>J&J'AJ2J3AJJ!I' $I' '#JJJJ)
r"   r   r   r   r   r   r   r   r   r   N)Z__name__Z
__module__Z__qualname__Z__firstlineno__r#   r   r!   r    r;   r=   rB   Z__static_attributes__Z__classdictcell__)r   s   @r   r   r      sD     +$ +$Z*
, ,D D% %7 7r   r   )r%   r   r6   Zosr3   rA   ZtempfileZtypingr    r   Z
exceptionsZpayloadsr   Zutilsr   r   r   r>   r   r   <module>rC      s4       	  
  "   /s7 s7r   