Creates a new PollStartEvent from a pure format. Note that the event is not parsed here: it will be treated as a literal m.poll.start primary typed event.
The event.
Readonly
answersThe possible answers for the poll.
Readonly
kindThe interpreted kind of poll. Note that this will infer a value that is known to the SDK rather than verbatim - this means unknown types will be represented as undisclosed polls.
To get the raw kind, use rawKind.
Readonly
maxThe maximum number of selections a user is allowed to make.
Readonly
questionThe question being asked, as a MessageEvent node.
Readonly
rawThe true kind as provided by the event sender. Might not be valid.
Readonly
wireDetermines if this event is equivalent to the provided event type.
This is recommended over instanceof
checks due to issues in the JS
runtime (and layering of dependencies in some projects).
Implementations should pass this check off to their super classes if their own checks fail. Some primary implementations do not extend fallback classes given they support the primary type first. Thus, those classes may return false if asked about their fallback representation.
Note that this only checks primary event types: legacy events, like m.room.message, should/will fail this check.
The (potentially namespaced) event type.
True if this event could be represented as the given type.
Serializes the event into a format which can be used to send the event to the room.
The serialized event.
Static
fromCreates a new PollStartEvent from question, answers, and metadata.
The question to ask.
The answers. Should be unique within each other.
The kind of poll.
The maximum number of selections. Must be 1 or higher.
The representative poll start event.
Generated using TypeDoc
Represents a poll start event.