Skip to main content

OneBotConnecter

本项目为onebot协议的非官方python整合, 允许用户快捷连接ws服务器,并收发信息。
本项目基于ll2接口开发。理论上面对其他基于onebot-11协议的接口同样可以运行,但是毕竟没实际测试过,本人不担保可以100%顺利运行。

!!!!!!

项目本身不包括任何机器人接口,请自行安装支持onebot协议的机器人接口并完成登录,再运行本项目!!!

项目结构

项目本身仅包括两个文件,OneBot.py及MessageType.py。
OneBot负责服务器的直接连接及信息的IO处理。
MessageType负责信息发送的数据包构造。
换而言之,需要 查询/修改 对服务器直接交互或信息收集行为的情况下,请直接查询或修改 OneBot.py。需要 查询/修改 向服务器发送的数据包内容或格式,请直接查询或修改 MessageType.py。

使用教程

本项目基于python异步运行,请确保asyncio库已被引入。
使用方法很简单:
1.构造收集到信息时需要运行的脚本函数,填入参数为(机器人本体bot, 信息数据包message)
2.通过本库创建OneBot对象并填入机器人基本信息,填入参数为(服务器地址, 管理员id, 机器人别称)
3.运行对象的run函数,并填入1步骤的脚本函数为参数,开始连接并监听服务器推送
具体可参考本项目的example文件,个人认为已经写得很清楚了。

安装

pip install OneBotConnecter

Metadata

Release files for OneBotConnecter 0.4.1

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

Source distribution (sdist)

Source distribution for OneBotConnecter 0.4.1
File Size Uploaded Provenance Actions
onebotconnecter-0.4.1.tar.gz 12.5 kB With provenance Details for onebotconnecter-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for OneBotConnecter 0.4.1
File Interpreter ABI Platform Actions
onebotconnecter-0.4.1-py3-none-any.whl Python 3 none any Details for onebotconnecter-0.4.1-py3-none-any.whl

Total release size: 24.7 kB

Release files / onebotconnecter-0.4.1.tar.gz

Download URL onebotconnecter-0.4.1.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
eb36faad675d5eca32b3158a1af891ef6694e80959dceca36ef27a68474df767
BLAKE2b-256 checksum
How to use checksums
c02484cd6e9440b83b6fa1e10295de6d78504bd1c473107cd50c8c35e373ab94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.

Transparency log

Release files / onebotconnecter-0.4.1-py3-none-any.whl

Download URL onebotconnecter-0.4.1-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c25e48a33463bd9318e9d58987c984d0ee6f94ab5c1c85ae4913d5bce2d8c79a
BLAKE2b-256 checksum
How to use checksums
70704eaa7f8eb705b8d1a93e14c9c07ed3e96b591a518c3cc6ca1a0795cf19a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.

Transparency log

Security for OneBotConnecter 0.4.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for onebotconnecter-0.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.

Transparency log

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.

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