Skip to main content

基于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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onebotconnecter-0.1.11.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

onebotconnecter-0.1.11-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file onebotconnecter-0.1.11.tar.gz.

File metadata

  • Download URL: onebotconnecter-0.1.11.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for onebotconnecter-0.1.11.tar.gz
Algorithm Hash digest
SHA256 0268bb419ca10c833e31d733afb98e3da759eaec2de5c292f477446ae888b81d
MD5 db1048ab05e904906727977793fd9611
BLAKE2b-256 dbd69adb58480dfd5ac44ab5f527a621d4d685a6d7cca01dfe9fa78c87014c9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for onebotconnecter-0.1.11.tar.gz:

Publisher: python-publish.yml on Sugar51243/OneBotConnecter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file onebotconnecter-0.1.11-py3-none-any.whl.

File metadata

File hashes

Hashes for onebotconnecter-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 e34fecd6b2fb3164a826e8788e443ee0c7c9e5e623c8b6b4ca6bcda27a0f1db7
MD5 eecbe399212f97ea91bff43e734b16b1
BLAKE2b-256 3f8fe6f680d5c217d384a558037e8705ae292ec5aac9a0ee7b698d2544186abd

See more details on using hashes here.

Provenance

The following attestation bundles were made for onebotconnecter-0.1.11-py3-none-any.whl:

Publisher: python-publish.yml on Sugar51243/OneBotConnecter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page