MessagePollManager

MessagePollManager

Manages a poll for a message.

Constructor

new MessagePollManager(existingResponses)

Description:
  • Creates a message poll manager.

Source:
Parameters:
Name Type Description
existingResponses Object

Existing responses for a poll.

Methods

_addVote(user_id, answer_id)

Description:
  • Adds a response to a poll.

Source:
Parameters:
Name Type Description
user_id String

The id of the user who voted.

answer_id Number

The id of the answer that was voted for.

Throws:
TypeError

_removeVote(user_id, answer_id)

Description:
  • Removes a response from a poll.

Source:
Parameters:
Name Type Description
user_id String

The id of the user whose vote was removed.

answer_id Number

The id of the answer for which the vote was removed.

Throws:
TypeError

toJSON(format) → {Object}

Description:
  • Returns the JSON representation of this structure.

Source:
Parameters:
Name Type Description
format Number

The format to return the data in.

Returns:
Type
Object