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.
22 lines
533 B
22 lines
533 B
package events |
|
|
|
// ActionEvent represents an action that took place, not a chat message. |
|
type ActionEvent struct { |
|
Event |
|
MessageEvent |
|
} |
|
|
|
// GetBroadcastPayload will return the object to send to all chat users. |
|
func (e *ActionEvent) GetBroadcastPayload() EventPayload { |
|
return EventPayload{ |
|
"id": e.ID, |
|
"timestamp": e.Timestamp, |
|
"body": e.Body, |
|
"type": e.GetMessageType(), |
|
} |
|
} |
|
|
|
// GetMessageType will return the type of message. |
|
func (e *ActionEvent) GetMessageType() EventType { |
|
return ChatActionSent |
|
}
|
|
|