package webhooks
import (
"github.com/owncast/owncast/core/chat/events"
"github.com/owncast/owncast/models"
)
func SendChatEvent(chatEvent *events.UserMessageEvent) {
webhookEvent := WebhookEvent{
Type: chatEvent.GetMessageType(),
EventData: &WebhookChatMessage{
User: chatEvent.User,
Body: chatEvent.Body,
RawBody: chatEvent.RawBody,
ID: chatEvent.Id,
Visible: chatEvent.HiddenAt == nil,
Timestamp: &chatEvent.Timestamp,
},
}
SendEventToWebhooks(webhookEvent)
func SendChatEventUsernameChanged(event events.NameChangeEvent) {
Type: models.UserNameChanged,
EventData: event,
// SendChatEventUserJoined sends a webhook notifying that a user has joined.
func SendChatEventUserJoined(event events.UserJoinedEvent) {
Type: models.UserJoined,