feat: Hello World! message handler finished

This commit is contained in:
AkashiNeko
2025-03-04 01:49:33 +08:00
parent 44f4c57d1a
commit b3652984cb
6 changed files with 150 additions and 81 deletions

15
handlers.go Normal file
View File

@@ -0,0 +1,15 @@
package main
import "go-hurobot/qbot"
func onGroupMessage(c *qbot.Client, msg qbot.GroupMessage) {
if msg.RawMessage == "hello" {
c.SendGroupMsg(msg.GroupID, "world", false)
}
}
func onPrivateMessage(c *qbot.Client, msg qbot.PrivateMessage) {
if msg.RawMessage == "hello" {
c.SendPrivateMsg(msg.Sender.UserID, "world", false)
}
}