feat(chat): add support for chat part messages. Closes #3201 (#3291)

This commit is contained in:
Gabe Kangas
2023-09-10 10:58:11 -07:00
committed by GitHub
parent fb0ac492b2
commit 169c11596c
15 changed files with 205 additions and 21 deletions

View File

@@ -0,0 +1,17 @@
package events
// UserPartEvent is the event fired when a user leaves chat.
type UserPartEvent struct {
Event
UserEvent
}
// GetBroadcastPayload will return the object to send to all chat users.
func (e *UserPartEvent) GetBroadcastPayload() EventPayload {
return EventPayload{
"type": UserParted,
"id": e.ID,
"timestamp": e.Timestamp,
"user": e.User,
}
}