Skip to main content

Bot Bin

Shared cogs and utilities for use in Discord bots. Some cogs require bot configuration; those that do expect a bot.config dict attribute.

bot_bin.bot

Contains an AutoShardedBot subclass. Contains custom error logging, customizable on_message bot ignoring, case insensitive prefixes, and database setup if the setup_db kwarg is set to True. Requires the config kwarg to be set to a dict. bot.config['tokens']['discord'] should be the bot's Discord token.

bot_bin.debug

Contains memory usage and performance debugging commands. Most other debug functionality is already provided by jishaku.

bot_bin.misc

Contains an uptime, ping, and copyright command. The latter requires bot.config['copyright_license_file'] to be set to a path to a text file, the contents of which will be sent when the user runs the copyright command.

Also contains various utilities:

  • codeblock wraps text in a markdown code block
  • absolute_natural_timedelta returns an English string representing an amount of seconds
  • natural_timedelta returns an English string representing the difference between two dates. This function differs from absolute_natural_timedelta in that it also supports years and months.
  • natural_rate returns an English string representing a rate of occurence.
  • plural is a format object which pluralizes strings. For example: f'Found {plural(len(results)):weapon}'
  • natural_join joins a sequence of strings according to English grammar
  • timeit is a context manager that times the code in the with block

bot_bin.sql

Contains SQL execution commands for asyncpg. Requires bot.pool to be set to either an asyncpg Connection or a ConnectionPool. Requires the bot_bin[sql] extra.

bot_bin.stats

Implements the guild count API for DBL, DBots, Bots For Discord, LBots, and Discord Boats. This is configured using bot.config['tokens']['stats']. Each key should be a domain, e.g. bot.config['tokens']['stats']['discordbots.org'] would be the bot's DBL token.

Defines a send-stats owner only command which sends the current guild counts to the configured APIs and reports any errors.

Metadata

Release files for bot-bin 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bot-bin 2.1.0
File Size Uploaded Provenance
bot_bin-2.1.0.tar.gz 16.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bot-bin 2.1.0
File Interpreter ABI Platform
bot_bin-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.8 kB

Release files / bot_bin-2.1.0.tar.gz

Download URL bot_bin-2.1.0.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b4259131c243ffaf37901a3fd8253ede25b5351f07ef1083839ef55e1a3189f5
BLAKE2b-256 checksum
How to use checksums
0035552407f30663e54c896c93d7c6444dd575657d3f9e1b5f018765f41427ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.6

Release files / bot_bin-2.1.0-py3-none-any.whl

Download URL bot_bin-2.1.0-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f45153439f00176503da7cd40d3d00503b3b79c986204ff48471fb723dd81879
BLAKE2b-256 checksum
How to use checksums
b083effe83cc57eb7c65a44516e25046efdba203d9a2c2e36557528b115843e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.6

Security for bot-bin 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page