tqdm.contrib.discord#
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}'):
... ...
tqdm_discord Objects#
class tqdm_discord(tqdm_auto)
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}'):
... ...
__init__#
def __init__(*args, **kwargs)
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.
tdrange#
def tdrange(*args, **kwargs)
Shortcut for tqdm.contrib.discord.tqdm(range(*args), **kwargs)
.