GoneBot
基于OneBot V11标准实现的GoSDK
Install / Use
/learn @2mf8/GoneBotREADME
GoneBot
使用方法
package main
import (
"fmt"
"github.com/2mf8/GoneBot"
"github.com/2mf8/GoneBot/onebot"
"github.com/gin-gonic/gin"
)
func main() {
gonebot.HandleConnect = func(bot *gonebot.Bot) {
fmt.Printf("新机器人已连接:%d\n", bot.BotId)
fmt.Println("所有机器人列表:")
for botId, _ := range gonebot.Bots {
println(botId)
}
}
gonebot.HandleGroupMessage = func(bot *gonebot.Bot, event *onebot.GroupMsgEvent) {
rawMsg := event.RawMessage
groupId := event.GroupId
userId := event.UserId
display := event.Sender.Card
replyMsg := gonebot.NewMsg().Text("hello world").At(userId, display).Text("你发送了:" + rawMsg)
_, _ = bot.SendGroupMessage(groupId, replyMsg, false)
}
router := gin.Default()
router.GET("/", func(c *gin.Context) {
if err := gonebot.UpgradeWebsocket(c.Writer, c.Request); err != nil {
fmt.Println("创建机器人失败")
}
})
if err := router.Run(":8081"); err != nil {
panic(err)
}
select {}
}
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
