1 changed files with 5 additions and 0 deletions
@ -1,17 +1,22 @@ |
|||||||
package webhooks |
package webhooks |
||||||
|
|
||||||
import ( |
import ( |
||||||
|
"time" |
||||||
|
|
||||||
"github.com/owncast/owncast/core/data" |
"github.com/owncast/owncast/core/data" |
||||||
"github.com/owncast/owncast/models" |
"github.com/owncast/owncast/models" |
||||||
|
"github.com/teris-io/shortid" |
||||||
) |
) |
||||||
|
|
||||||
func SendStreamStatusEvent(eventType models.EventType) { |
func SendStreamStatusEvent(eventType models.EventType) { |
||||||
SendEventToWebhooks(WebhookEvent{ |
SendEventToWebhooks(WebhookEvent{ |
||||||
Type: eventType, |
Type: eventType, |
||||||
EventData: map[string]interface{}{ |
EventData: map[string]interface{}{ |
||||||
|
"id": shortid.MustGenerate(), |
||||||
"name": data.GetServerName(), |
"name": data.GetServerName(), |
||||||
"summary": data.GetServerSummary(), |
"summary": data.GetServerSummary(), |
||||||
"streamTitle": data.GetStreamTitle(), |
"streamTitle": data.GetStreamTitle(), |
||||||
|
"timestamp": time.Now(), |
||||||
}, |
}, |
||||||
}) |
}) |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue