Giter Site home page Giter Site logo

nonebot-rs's Introduction

Nonebot-rs

license

A Onebot SDK in Rust

计划是实现 Nonebot2 的完整架构

一个基础功能完备的可扩展 Onebot SDK ,使用 Plugin 作为扩展。nbrs 本体负责与 Onebot 实现端建立连接、将 Onebot 通信转化抽象为 Event 与 Bot (可以调用 Onebot Api 的 struct),并向各 Plugin 分发、读取配置文件。

目前作为 feature 内建有 matcher (与 Nonebot 类似机制的匹配处理机制)、scheduler (定时任务) Plugin。(其实 logger 也是一个内建插件)。

目前已经有计划的 Plugin 有: nbrs_lua(lua)、nbrs_py(Python)。

API文档地址:Docs.rs

各项目简介

  • nonebot_rs: nbrs 本体
  • nbrs_no4: nbrs 实例项目
  • nbrs_lua: 使用 lua 为 nbrs 编写插件 (仅最小实例可用)
  • nbrs_py: nbrs Python Plugin (To-do)
  • nbrs_matcher_r6s: nbrs Rainbow Six Siege 战绩查询插件

To-Do List

nonebot_rs
  • onebot 通讯方式
    • HTTP (无限期推迟)
    • 正向 WS (Err 未全部处理)
    • 反向 WS
  • Onebot v11 标准接口实现 (使用 serde 实现)
  • Onebot v12 实现 (v12 发布在即!)
  • matcher
    • Built-in matcher
      • echo (基础应答功能)
      • Rcnb (对话功能实现)
    • built-in rules pre_matchers
  • config
    • 基本设置
    • bot 设置
    • Plugin 设置
  • Message 构建 API 完善
  • Plugin
  • 文档
  • 定时任务
  • 声明宏
  • logger (tracing-subscriber)
nbrs_lua
  • 最小实例
  • More Developer-friendly api for lua
nbrs_py
  • 最小实例

特别鸣谢

OneBot: 一个聊天机器人应用接口标准,旨在统一不同聊天平台上的机器人应用开发接口,使开发者只需编写一次代码即可应用到多种机器人平台。

Nonebot2: 可扩展的 Python 异步机器人框架。(本项目的思路来源与模仿对象,妈!)

开发者只是一个非专业半吊子编程爱好者,如果发现 Bug || 低效算法 || 脱裤子放屁操作,请不吝指教(务必 Issue)

说明

简单说明一下项目运行配置

[global]                     # 全局设置
debug = true                 # 开启 debug log
superusers = ["YourID"]      # 全局管理员账号
nicknames = ["nickname"]     # 全局 Bot 昵称
command_starts = ["/"]       # 全局命令起始符

[ws_server]                  # 反向 WS 服务器
host = "127.0.0.1"           # 监听 host
port = 8088                  # 监听 port
access_token = "AccessToken" # 连接鉴权使用

[bots.BotID]                 # Bot 设置
superusers = ["YourID"]      # 管理员账户
nicknames = ["nickname"]     # Bot 昵称
command_starts = ["/"]       # 命令起始符
ws_server = "server address" # 正向 WS 服务器地址(缺省不启用正向 WS 连接)
access_token = "AccessToken" # 连接鉴权使用

global 设置所有 bot 生效,特别设置后 global 设置将被覆盖。

nbrs 最小实例请看 nonebot_rs/src/bin/minimal.rs 或 nbrs_no4/src/main.rs

matcher 声明请看 nonebot_rs/src/builtin/echo.rs

scheduler 声明可以查看 nbrs_no4/src/clock.rs

目前本项目 Api 初步稳定。

nonebot-rs's People

Contributors

abrahum avatar starhearthunt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.