mirror of
https://github.com/awfufu/qbot.git
synced 2026-03-01 13:29:43 +08:00
init: first commit
This commit is contained in:
18
api/get_msg.go
Normal file
18
api/get_msg.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package api
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
func GetMsg(c Client, messageID int32) (*MessageJson, error) {
|
||||
params := map[string]any{
|
||||
"message_id": messageID,
|
||||
}
|
||||
data, err := c.Send("get_msg", params)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var resp MessageJson
|
||||
if err := json.Unmarshal(data, &resp); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &resp, nil
|
||||
}
|
||||
Reference in New Issue
Block a user