Files
napcat/doc.go

18 lines
687 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Package napcat 是对接 NapCatQQ(OneBot 11 协议)的 Go 软件包。
//
// 通过 New 创建与 NapCat 交互的客户端对象,Set* 方法配置连接方式
// (正向/反向 WebSocket、HTTP API、HTTP POST 上报),On* 注册事件处理,
// Run 启动后即可直接调用对象上的 80+ 个 NapCat 接口。
//
// bot := napcat.New().SetToken("xxx").SetForwardWS("ws://127.0.0.1:3001")
// bot.OnMessage(func(c *napcat.Context) {
// if c.HasAtMe() {
// c.ReplyText("hi")
// }
// })
// bot.Run(ctx)
//
// 支持 OneBot 11 标准 API、go-cqhttp 兼容 API 与 NapCat 扩展 API;
// 未收录的接口可用 Context.Call / Client.Call 裸调。
package napcat