eventType.go 1.2 KB

1234567891011121314151617181920212223242526272829
  1. package models
  2. // EventType is the type of a websocket event.
  3. type EventType = string
  4. const (
  5. // MessageSent is the event sent when a chat event takes place.
  6. MessageSent EventType = "CHAT"
  7. // UserJoined is the event sent when a chat user join action takes place.
  8. UserJoined EventType = "USER_JOINED"
  9. // UserNameChanged is the event sent when a chat username change takes place.
  10. UserNameChanged EventType = "NAME_CHANGE"
  11. // VisibiltyToggled is the event sent when a chat message's visibility changes.
  12. VisibiltyToggled EventType = "VISIBILITY-UPDATE"
  13. // PING is a ping message.
  14. PING EventType = "PING"
  15. // PONG is a pong message.
  16. PONG EventType = "PONG"
  17. // StreamStarted represents a stream started event.
  18. StreamStarted EventType = "STREAM_STARTED"
  19. // StreamStopped represents a stream stopped event.
  20. StreamStopped EventType = "STREAM_STOPPED"
  21. // StreamTitleUpdated is the event sent when a stream's title changes.
  22. StreamTitleUpdated EventType = "STREAM_TITLE_UPDATED"
  23. // SystemMessageSent is the event sent when a system message is sent.
  24. SystemMessageSent EventType = "SYSTEM"
  25. // ChatActionSent is a generic chat action that can be used for anything that doesn't need specific handling or formatting.
  26. ChatActionSent EventType = "CHAT_ACTION"
  27. )