You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
589 B
23 lines
589 B
package webhooks |
|
|
|
import ( |
|
"time" |
|
|
|
"github.com/owncast/owncast/core/data" |
|
"github.com/owncast/owncast/models" |
|
"github.com/teris-io/shortid" |
|
) |
|
|
|
// SendStreamStatusEvent will send all webhook destinations the current stream status. |
|
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(), |
|
}, |
|
}) |
|
}
|
|
|