mirror of
https://github.com/awfufu/go-hurobot.git
synced 2026-03-01 13:39:42 +08:00
feat: Hello World! message handler finished
This commit is contained in:
15
handlers.go
Normal file
15
handlers.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user