Skip to main content

No project description provided

Project description

nonebot-adapter-onebot-pretender

With some magic ✨

测试过的版本

  • nonebot2 2.1.0
  • nonebot-adapter-onebot 2.3.0
  • nonebot-adapter-red 0.5.1

由于本项目的特殊性,不保证在其他版本的nonebot/red适配器中也能工作。

DEMO

1、创建一个bot.py

2、写入下列内容

import nonebot
from nonebot import on_command

from nonebot_adapter_onebot_pretender import create_ob11_adapter_pretender, init_onebot_pretender

# init_onebot_pretender 必须在 import adapter 之前

nonebot.init()
init_onebot_pretender()

from nonebot.adapters.red import Adapter as RedAdapter
from nonebot.adapters.onebot.v11 import PrivateMessageEvent, Bot

driver = nonebot.get_driver()

driver.register_adapter(create_ob11_adapter_pretender(RedAdapter))


@on_command("hello").handle()
async def handle_hello(bot: Bot, event: PrivateMessageEvent):
    await bot.send(event, "world")


if __name__ == "__main__":
    nonebot.run()

3、开润

已支持

  • RedProtocol
    • 消息接收
      • 纯文本
      • 图片、视频、语音
      • 引用
      • 表情
    • 消息发送
      • 纯文本
      • 图片、视频、语音
      • 引用
      • 表情
      • 合并转发(调不通orz)
    • 消息发送者角色判断(消息上报少字段orz)
    • 其他OB11事件
      • 群成员禁言/解除禁言事件
      • 群成员加入事件 (包括旧版受邀请入群)
      • 群名称改动事件
    • 其他OB11 API
      • 获取自身资料get_login_info
      • 获取好友、群组get_friend_list/get_group_list
      • 消息撤回
      • 获取群组内群员资料get_group_member_list(调不通orz [https://github.com/chrononeko/bugtracker/issues/12])
      • 禁言/解禁群员
      • 全体禁言
      • 获取群公告
      • 获取历史消息

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

nonebot_adapter_onebot_pretender-0.1.1.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file nonebot_adapter_onebot_pretender-0.1.1.tar.gz.

File metadata

File hashes

Hashes for nonebot_adapter_onebot_pretender-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7f80d61d2006b81aaec21d98efd3b5586c8bd6873d5e3ba3d236b6ae44d560c9
MD5 93b98d46c2a9f1a80962ed297fb9bd55
BLAKE2b-256 0e38fec65afdf19eb5e6b256ecc9be1628a5ed372e2099b9ae96df1a89d63414

See more details on using hashes here.

File details

Details for the file nonebot_adapter_onebot_pretender-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_adapter_onebot_pretender-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6068dcf12cf01e8069d3a141805242537c7edc544db2e61ebe29f6a390c512c5
MD5 df2cf9bed8f4b3a8f9fbc838f34a70c6
BLAKE2b-256 23119ef4ec81b244c470de52bd39dac860eef8ff37b81adf47f319c0b3b1f82f

See more details on using hashes here.

Supported by

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