owncast/core/webhooks/stream.go
2021-08-12 20:02:17 -07:00

22 lines
502 B
Go

package webhooks
import (
"time"
"github.com/owncast/owncast/core/data"
"github.com/owncast/owncast/models"
"github.com/teris-io/shortid"
)
func SendStreamStatusEvent(eventType models.EventType) {
SendEventToWebhooks(WebhookEvent{
Type: eventType,
EventData: map[string]interface{}{
"id": shortid.MustGenerate(),
"name": data.GetServerName(),
"summary": data.GetServerSummary(),
"streamTitle": data.GetStreamTitle(),
"timestamp": time.Now(),
},
})
}