diff --git a/README.md b/README.md index de555a4..6bf1a2a 100644 --- a/README.md +++ b/README.md @@ -715,6 +715,12 @@ Available events are listed below: * **Message Notify Unread Received** [`user`, `plugin`]: * `message:notify:unread:received` +* #### **Spam Events**: [Reference](https://docs.crisp.chat/references/rtm-api/v1/#spam-events) + * **Spam Message** [`user`]: + * `spam:message` + * **Spam Decision** [`user`]: + * `spam:decision` + * #### **People Events**: [Reference](https://docs.crisp.chat/references/rtm-api/v1/#people-events) * **People Profile Created** [`user`, `plugin`]: * `people:profile:created` diff --git a/crisp/events.go b/crisp/events.go index e6e148e..5fdc3e3 100644 --- a/crisp/events.go +++ b/crisp/events.go @@ -697,6 +697,25 @@ type EventsReceiveMessageNotify struct { EventsSessionGeneric } +// EventsSpamMessage maps spam:message +type EventsSpamMessage struct { + EventsGeneric + EventsWebsiteGeneric + SpamID *string `json:"spam_id"` + Type *string `json:"type"` + Reason *string `json:"reason"` + Metadata *interface{} `json:"metadata,omitempty"` + Headers *interface{} `json:"headers,omitempty"` + Timestamp *uint64 `json:"timestamp"` +} + +// EventsSpamDecision maps spam:decision +type EventsSpamDecision struct { + EventsGeneric + EventsWebsiteGeneric + Action *string `json:"action"` +} + // EventsReceivePeopleProfileCreated maps people:profile:created type EventsReceivePeopleProfileCreated struct { EventsGeneric @@ -1213,6 +1232,18 @@ func (evt EventsReceiveMessageNotify) String() string { } +// String returns the string representation of EventsSpamMessage +func (evt EventsSpamMessage) String() string { + return Stringify(evt) +} + + +// String returns the string representation of EventsSpamDecision +func (evt EventsSpamDecision) String() string { + return Stringify(evt) +} + + // String returns the string representation of EventsReceivePeopleProfileCreated func (evt EventsReceivePeopleProfileCreated) String() string { return Stringify(evt)