bub-discord
Discord channel adapter for bub.
What It Provides
- Channel implementation:
DiscordChannel(name = "discord") - Inbound message adaptation from Discord to Bub
ChannelMessage - Outbound sending to Discord channels with:
- automatic chunking at Discord's 2000-character limit
- reply-to-latest-message behavior per session
Installation
uv pip install bub-discord
You can also install it with Bub:
bub install bub-discord
Configuration
DiscordChannel reads settings from environment variables with the BUB_DISCORD_ prefix.
BUB_DISCORD_TOKEN(required): Discord bot tokenBUB_DISCORD_ALLOW_USERS(optional): Comma-separated allowlist of sender identifiers- Supports user ID, username, and global name
BUB_DISCORD_ALLOW_CHANNELS(optional): Comma-separated allowlist of channel IDsBUB_DISCORD_COMMAND_PREFIX(optional, default:!)BUB_DISCORD_PROXY(optional): HTTP proxy URL for Discord API
Runtime Behavior
- Session ID format:
discord:<channel_id> - Inbound messages:
- ignores bot messages
- ignores empty text messages
- applies allowlist filters when configured
- Message activation (
is_active = true) when any of these is true:- message is in DM
- message mentions the bot
- content contains
bub - content starts with
<prefix>bub - message replies to a previous bot message
- Command detection:
- if content starts with
<prefix>bub, that prefix is removed first - if remaining content starts with
,, message kind becomescommand
- if content starts with
Payload Shape
Inbound non-command messages are encoded as JSON string content, including fields like:
messagemessage_idtypeusernamefull_namesender_iddatechannel_idguild_idreply_to_message(when present)
Outbound Notes
- Uses
session_idto resolve destination channel. - Splits long messages into multiple Discord posts.
- Replies to the latest inbound message in the same session when possible.
Metadata
Release files for bub-discord 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bub_discord-0.0.2.tar.gz | 9.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bub_discord-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.7 kB
Release files / bub_discord-0.0.2.tar.gz
| Download URL | bub_discord-0.0.2.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27b3f0e1fc3ec9d5a370ddf472a9994db0ea1cfa364be61d240f4612b1136b21
|
|
BLAKE2b-256 checksum How to use checksums |
6a9edadbbf98c4ca67f12ebf497d21ba6e28fbb535c8380456a3dcf612144740
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / bub_discord-0.0.2-py3-none-any.whl
| Download URL | bub_discord-0.0.2-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b6c369beacb25f8c05c417a36a3565a0876ebc334dd23cee6cef1c105f8059e1
|
|
BLAKE2b-256 checksum How to use checksums |
ffde0a854b178ac92556857de0d3afd0934df111558c203ec082f8fb0338ae27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for bub-discord 0.0.2
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.