+
    Bi{                         R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^RI	H
t ^RIHt ^RIHt ^RIHt R	R
R./t. ROt ! R R]4      t ! R R]4      tR t]t
]tR# )z
Sends updates to a Discord bot.

Usage:
>>> from tqdm.contrib.discord import tqdm, trange
>>> for i in trange(10, token='{token}', channel_id='{channel_id}'):
...     ...

![screenshot](https://tqdm.github.io/img/screenshot-discord.png)
)getenv)warn)Session)default_user_agent)tqdm)TqdmWarning)__version__)
MonoWorkerzgithub.com/	casperdcl
guigoruiz1	DiscordIOtqdm_discordc                   p   a a ] tR t^t oRtRtR] R]! 4        2tV 3R lt	]
R 4       tR tR tR	tVtV ;t# )
r   z.Non-blocking file-like IO using a Discord Bot.zhttps://discord.com/api/v10ztqdm (https://tqdm.github.io, z) c                   < \         SV `  4        Wn        W n        \	        4       V n        V P                  P                  V n        V P                   R# )z0Creates a new message in the given `channel_id`.N)
super__init__token
channel_idr   session	__class____name__text
message_id)selfr   r   r   s   &&&9/usr/lib/python3.14/site-packages/tqdm/contrib/discord.pyr   DiscordIO.__init__   s9    
$yNN++	    c                   \        V R 4      '       d   V P                  #  V P                  P                  V P                   RV P
                   R2RRV P                   2RV P                  /RRV P                   R2/R7      P                  4       pVP                  R	4      R
8X  d   \        R\        ^R7       R# VR,          V n        V P                  #   \         d+   p\        P                  ! \!        T4      4        Rp?R# Rp?ii ; i)_message_id
/channels/z	/messagesAuthorizationBot 
User-Agentcontent`headersjson
error_codei  z2Creation rate limit: try increasing `mininterval`.)
stacklevelidN)hasattrr   r   postAPIr   r   UAr   r'   getr   r   	Exception	tqdm_autowritestr)r   reses   &  r   r   DiscordIO.message_id(   s    4''###	(,,##88*Jt&7yA(D*=|TWWU1TYYKq!12 $ 4 59DF  ww|$+I Q0 $'t9 '''  	$OOCF##	$s   A1C D
 DD
c           	         V'       g   RpVP                  RR4      P                  4       pWP                  8X  d   R# V P                  pVf   R# Wn         V P	                  V P
                  P                  V P                   RV P                   RV 2RRV P                   2R	V P                  /R
RV P                   R2/R7      pV#   \         d+   p\        P                  ! \        T4      4        Rp?R# Rp?ii ; i)z/Replaces internal `message_id`'s text with `s`.z... Nr   
/messages/r    r!   r"   r#   r$   r%   )replacestripr   r   submitr   patchr-   r   r   r.   r0   r1   r2   r3   )r   sr   futurer5   s   &&   r   r2   DiscordIO.write;   s    AIIdB%%'		>__
			[[""88*Jt&7z*N(D*=|TWWU1TYYKq!12	 ! 4F M  	$OOCF##	$s   A0C C=C88C=c                J    V P                  V P                  P                  V P                   RV P                   RV P
                   2RRV P                   2RV P                  /R7      pV#   \         d+   p\        P                  ! \        T4      4        Rp?R# Rp?ii ; i)zDeletes internal `message_id`.r   r:   r    r!   r"   )r&   N)r=   r   deleter-   r   r   r   r.   r0   r1   r2   r3   )r   r@   r5   s   &  r   rC   DiscordIO.deleteQ   s    	[[##88*Jt&7z$//ARS(D*=|TWWU ! WF M  	$OOCF##	$s   A)A- -B"8BB")r   r   r   r   r   )r   
__module____qualname____firstlineno____doc__r-   r   r   r.   r   propertyr   r2   rC   __static_attributes____classdictcell____classcell__r   __classdict__s   @@r   r   r      sL     8
'C)+b9K9M8N	OB ( ($,
 
r   c                   Z   a a ] tR t^^t oRtV 3R ltV 3R ltV 3R ltV 3R ltRt	Vt
V ;t# )r   a  
Standard `tqdm.auto.tqdm` but also sends updates to a Discord Bot.
May take a few seconds to create (`__init__`).

- create a discord bot (not public, no requirement of OAuth2 code
  grant, only send message permissions) & invite it to a channel:
  <https://discordpy.readthedocs.io/en/latest/discord.html>
- copy the bot `{token}` & `{channel_id}` and paste below

>>> from tqdm.contrib.discord import tqdm, trange
>>> for i in tqdm(iterable, token='{token}', channel_id='{channel_id}'):
...     ...
c           	        < VP                  R4      '       gT   VP                  4       p\        VP                  R\	        R4      4      VP                  R\	        R4      4      4      V n        \        SV `  ! V/ VB  R# )z
Parameters
----------
token  : str, required. Discord bot token
    [default: ${TQDM_DISCORD_TOKEN}].
channel_id  : int, required. Discord channel ID
    [default: ${TQDM_DISCORD_CHANNEL_ID}].

See `tqdm.auto.tqdm.__init__` for other parameters.
disabler   TQDM_DISCORD_TOKENr   TQDM_DISCORD_CHANNEL_IDN)r/   copyr   popr   dior   r   r   argskwargsr   s   &*,r   r   tqdm_discord.__init__l   sh     zz)$$[[]F 

7F+?$@A

<0I)JKMDH 	$)&)r   c                *  < \         SV `  ! R/ VB  V P                  pVP                  R R4      '       d.   VR ,          P	                  RR4      P	                  RR4      VR &   MRVR &   V P
                  P                  V P                  ! R/ VB 4       R# )
bar_formatNz<bar/>z	{bar:10u}z{bar}z{l_bar}{bar:10u}{r_bar} )r   displayformat_dictr/   r;   rV   r2   format_meter)r   rY   fmtr   s   &, r   r^   tqdm_discord.display~   s    !&!77<&& #L 1 9 9+!''.ww'D  !:Ct((/3/0r   c                   < \         SV `  ! V/ VB  V P                  '       g   V P                  P	                  R 4       R# R# )r9   N)r   clearrQ   rV   r2   rW   s   &*,r   rd   tqdm_discord.clear   s2    t&v&|||HHNN2 r   c                   < V P                   '       d   R # \        SV `	  4        V P                  '       g>   V P                  f   V P                  ^ 8X  g   V P
                  P                  4        R # R # R # )N)rQ   r   closeleaveposrV   rC   )r   r   s   &r   rg   tqdm_discord.close   sJ    <<<


tzz1dhh!mHHOO 7D
r   )rV   )r   rE   rF   rG   rH   r   r^   rd   rg   rJ   rK   rL   rM   s   @@r   r   r   ^   s#     *$1
 r   c                 (    \        \        V !  3/ VB # )zAShortcut for `tqdm.contrib.discord.tqdm(range(*args), **kwargs)`.)r   range)rX   rY   s   *,r   tdrangerm      s    t///r   N)r   r   rm   r   trange)rH   osr   warningsr   requestsr   requests.utilsr   autor   r1   stdr   versionr   utils_workerr	   
__author____all__r   r   rm   rn   r]   r   r   <module>ry      se   	    - $  ! $k<89

DA
 AH49 4n0 	r   