Poll

Poll

Class representing a poll

Constructor

new Poll()

Members

(static) Status

Properties:
Name Type Description
OPEN string

"open"

CLOSED string

"closed"

REMOVED string

"removed"

String enum object for the poll status.

(nullable) details :Array.<module:model/pollDetails~PollDetails>

Default Value:
  • null
Type:

id :number

Default Value:
  • 0
Type:
  • number

title :string

Default Value:
  • ""
Type:
  • string

Methods

(static) create(params, callback) → {Promise.<module:model/poll~Poll>|undefined}

Create the poll with params but not attached to the message yet.

Parameters:
Name Type Description
params module:model/params/pollParams~PollParams
callback pollCallback
Returns:
Type
Promise.<module:model/poll~Poll> | undefined

(static) get(pollId, callback) → {Promise.<module:model/poll~Poll>|undefined}

Get the poll.

Parameters:
Name Type Description
pollId module:model/params/pollParams~PollParams
callback pollCallback
Returns:
Type
Promise.<module:model/poll~Poll> | undefined

addOption(channelUrl, text, callback) → {Promise.<module:model/poll~Poll>|undefined}

Add the poll option.

Parameters:
Name Type Description
channelUrl string
text string
callback pollCallback
Returns:
Type
Promise.<module:model/poll~Poll> | undefined

close(callback) → {Promise.<module:model/poll~Poll>|undefined}

Close the poll.

Parameters:
Name Type Description
callback commonCallback
Returns:
Type
Promise.<module:model/poll~Poll> | undefined

delete(callback)

Delete the poll.

Parameters:
Name Type Description
callback commonCallback

update(params, callback) → {Promise.<module:model/poll~Poll>|undefined}

Update the poll.

Parameters:
Name Type Description
params module:model/params/pollParams~PollParams
callback commonCallback
Returns:
Type
Promise.<module:model/poll~Poll> | undefined

vote(channelUrl, optionIds, callback) → {Promise.<module:model/poll~Poll>|undefined}

Vote the poll.

Parameters:
Name Type Description
channelUrl string
optionIds Array.<number>
callback pollCallback
Returns:
Type
Promise.<module:model/poll~Poll> | undefined