Skip to main content
  • create(chat, title, choices, options) creates a poll message.
  • get(pollMessage) reads the latest poll state.
  • vote(pollMessage, optionId, options) casts or changes the local account’s vote.
  • unvote(pollMessage, options) removes the local account’s vote.
  • addOption(pollMessage, text, options) appends a new choice.
  • subscribeEvents(filter) streams poll changes.

Methods

addOption()

Parameters

string
required
string
required

Returns

Poll

create()

Parameters

string
required
string
required
string[]
required

Returns

Poll

get()

Parameters

string
required

Returns

Poll

subscribeEvents()

Parameters

{ pollMessage: string }

Returns

TypedEventStreamPollEvent

unvote()

Parameters

string
required

Returns

Poll

vote()

Parameters

string
required
string
required

Returns

Poll