grain/server/handlers/response/notice.go

14 lines
283 B
Go
Raw Normal View History

2024-07-25 14:19:42 +00:00
package response
2024-07-24 21:10:20 +00:00
import (
"encoding/json"
"golang.org/x/net/websocket"
)
2024-07-25 03:04:26 +00:00
func SendNotice(ws *websocket.Conn, pubKey, message string) {
2024-07-24 21:10:20 +00:00
notice := []interface{}{"NOTICE", pubKey, message}
noticeBytes, _ := json.Marshal(notice)
websocket.Message.Send(ws, string(noticeBytes))
}