wdvxdr1123 / ZeroBot

一个基于onebot协议的机器人Go开发框架
GNU General Public License v3.0
326 stars 71 forks source link

ZeroBot

Go Report Card golangci-lint Badge Badge License qq group

文档正在咕咕中, 具体使用可以参考example文件夹。

⚡️ 快速使用

package main

import (
    zero "github.com/wdvxdr1123/ZeroBot"
    "github.com/wdvxdr1123/ZeroBot/driver"
)

func main() {
    zero.OnCommand("hello").
            Handle(func(ctx *zero.Ctx) {
                ctx.Send("world")
            })

    zero.RunAndBlock(&zero.Config{
        NickName:      []string{"bot"},
        CommandPrefix: "/",
        SuperUsers:    []int64{123456},
        Driver: []zero.Driver{
            // 正向 WS
            driver.NewWebSocketClient("ws://127.0.0.1:6700", ""),
            // 反向 WS
            driver.NewWebSocketServer(16, "ws://127.0.0.1:6701", ""),
        },
    }, nil)
}

🎯 特性

关联项目

特别感谢

同时感谢以下开发者对 ZeroBot 作出的贡献: