Skip to content

wdvxdr1123/ZeroBot

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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)
}

🎯 特性

  • 通过 init 函数实现插件式
  • 底层与 Onebot 通信驱动可换,目前支持正向/反向WS,且支持基于 unix socket 的通信(使用 ws+unix://
  • 通过添加多个 driver 实现多Q机器人支持

关联项目

特别感谢

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

About

一个基于onebot协议的机器人Go开发框架

Resources

License

Stars

Watchers

Forks

Languages