grain/relay/handlers/kinds/notice.go

14 lines
280 B
Go
Raw Normal View History

2024-07-24 21:10:20 +00:00
package kinds
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))
}