onebot-protocol
OneBot 通信协议,定义消息收发的公共数据结构。基于OneBot 11标准,使用 Pydantic 提供类型安全的模型定义。
特性
- 完整的消息段(Message Segment)类型:文本、提及、图片、语音、视频、文件、位置、回复等
- 图片、语音、音频、视频、文件段共用
FileData(name、content、mime_type、size) - 支持 discriminated union,根据
type字段自动解析消息类型
文件载荷 FileData
| 字段 | 说明 |
|---|---|
name |
显示用文件名(可选) |
content |
内容引用,如 URL、平台资源标识或 Base64 等(可选,编码由实现方约定) |
mime_type |
MIME 类型(可选) |
size |
字节大小(可选) |
image / voice / audio / video / file 各段类型的 data 均为对应子类,字段与 FileData 相同。
支持的消息类型
| 类型 | 说明 |
|---|---|
text |
纯文本 |
mention |
@某人 |
mention_all |
@所有人 |
image |
图片 |
voice |
语音 |
audio |
音频 |
video |
视频 |
file |
文件 |
location |
位置 |
reply |
回复 |
Metadata
Release files for onebot-protocol 0.2.0
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 | |
|---|---|---|---|---|
| onebot_protocol-0.2.0.tar.gz | 4.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| onebot_protocol-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.3 kB
Release files / onebot_protocol-0.2.0.tar.gz
| Download URL | onebot_protocol-0.2.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e4feb2768959d28f670749eb481059e411f5d84a56d92163c6b265db69a902a0
|
|
BLAKE2b-256 checksum How to use checksums |
631deba938b209a4aecdb07a276b92621bd8a465220311339e6e929c8709703d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.6
|
Release files / onebot_protocol-0.2.0-py3-none-any.whl
| Download URL | onebot_protocol-0.2.0-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a6a2c42594f0d91e0989826b586b8faf29ed2252de1e6a524f50cb22da3a997d
|
|
BLAKE2b-256 checksum How to use checksums |
743670f0bd11b803b0acbe2851e0406b295e7ae02381143f70e01204bcc5d8c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.6
|
Security for onebot-protocol 0.2.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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.