EDA.Poll.AnswerCount (EDA v0.3.0)

Copy Markdown View Source

Represents the vote count for a specific poll answer.

Provides typed access to vote counts instead of raw maps.

Example

%EDA.Poll.AnswerCount{
  id: 1,
  count: 42,
  me_voted: false
}

Summary

Functions

Parses an answer count from a raw Discord API map.

Types

t()

@type t() :: %EDA.Poll.AnswerCount{
  count: integer(),
  id: integer(),
  me_voted: boolean()
}

Functions

from_raw(raw)

@spec from_raw(map()) :: t()

Parses an answer count from a raw Discord API map.

Examples

iex> EDA.Poll.AnswerCount.from_raw(%{"id" => 1, "count" => 42, "me_voted" => false})
%EDA.Poll.AnswerCount{id: 1, count: 42, me_voted: false}