基于websocket(服务器正向)连接的onebot11通用python接口
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file onebotconnecter-0.4.2.tar.gz.
File metadata
- Download URL: onebotconnecter-0.4.2.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5fb265a51f6e15d71a8516863f2d3406626ca6239efdf9bf547c2ab1ceaeccd
|
|
| MD5 |
2a2cb4840bb9366e2e165528b9a07245
|
|
| BLAKE2b-256 |
83da78959683dddbdd4696eb05e2a168b98ca3f2ca3e66209864924d7ef45ee9
|
Provenance
The following attestation bundles were made for onebotconnecter-0.4.2.tar.gz:
Publisher:
python-publish.yml on Sugar51243/OneBotConnecter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
onebotconnecter-0.4.2.tar.gz -
Subject digest:
c5fb265a51f6e15d71a8516863f2d3406626ca6239efdf9bf547c2ab1ceaeccd - Sigstore transparency entry: 1174129185
- Sigstore integration time:
-
Permalink:
Sugar51243/OneBotConnecter@14cf4f71f55378a69fec8744e1992c58b0e99ad8 -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/Sugar51243
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@14cf4f71f55378a69fec8744e1992c58b0e99ad8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file onebotconnecter-0.4.2-py3-none-any.whl.
File metadata
- Download URL: onebotconnecter-0.4.2-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1dc18477674615593f8258ef73b566d2623853674c7afcb2c269a044692818c
|
|
| MD5 |
93aade74477cd3c2c3e1d34760e9e503
|
|
| BLAKE2b-256 |
7072b032bd9e65ad99020caf246519d76f29414a45fa0057fd9831b0e9bfd1c9
|
Provenance
The following attestation bundles were made for onebotconnecter-0.4.2-py3-none-any.whl:
Publisher:
python-publish.yml on Sugar51243/OneBotConnecter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
onebotconnecter-0.4.2-py3-none-any.whl -
Subject digest:
d1dc18477674615593f8258ef73b566d2623853674c7afcb2c269a044692818c - Sigstore transparency entry: 1174129235
- Sigstore integration time:
-
Permalink:
Sugar51243/OneBotConnecter@14cf4f71f55378a69fec8744e1992c58b0e99ad8 -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/Sugar51243
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@14cf4f71f55378a69fec8744e1992c58b0e99ad8 -
Trigger Event:
release
-
Statement type: