grom/message/poll

Types

pub type Answer {
  Answer(answer_id: Int, poll_media: Media)
}

Constructors

  • Answer(answer_id: Int, poll_media: Media)
pub type AnswerCount {
  AnswerCount(id: Int, count: Int, current_user_voted: Bool)
}

Constructors

  • AnswerCount(id: Int, count: Int, current_user_voted: Bool)
pub type Create {
  Create(
    question: CreateQuestion,
    answers: List(CreateAnswer),
    duration: option.Option(duration.Duration),
    allow_multiselect: Bool,
    layout_type: option.Option(LayoutType),
  )
}

Constructors

pub type CreateAnswer {
  CreateAnswer(media: Media)
}

Constructors

  • CreateAnswer(media: Media)
pub type CreateQuestion {
  CreateQuestion(text: option.Option(String))
}

Constructors

pub type GetAnswerVotersQuery {
  AfterUserId(String)
  Limit(Int)
}

Constructors

  • AfterUserId(String)
  • Limit(Int)
pub type LayoutType {
  Default
}

Constructors

  • Default
pub type Media {
  Media(
    text: option.Option(String),
    emoji: option.Option(emoji.Emoji),
  )
}

Constructors

pub type Poll {
  Poll(
    question: Media,
    answers: List(Answer),
    expiry: option.Option(timestamp.Timestamp),
    allows_multiselect: Bool,
    layout_type: LayoutType,
    results: option.Option(Results),
  )
}

Constructors

pub type Results {
  Results(is_finalized: Bool, answer_counts: List(AnswerCount))
}

Constructors

  • Results(is_finalized: Bool, answer_counts: List(AnswerCount))

Values

pub fn get_voters_for_answer(
  client: grom.Client,
  in channel_id: String,
  on message_id: String,
  regarding answer_id: String,
  using query: List(GetAnswerVotersQuery),
) -> Result(List(user.User), grom.Error)
pub fn new_create(
  asking question: CreateQuestion,
  answers answers: List(CreateAnswer),
  allowing_multiselect allow_multiselect: Bool,
) -> Create
pub fn new_create_question() -> CreateQuestion
pub fn new_media() -> Media
Search Document