Site polls - developer-run polls on the dashboard ("which feature next?").

── WHO SEES WHAT ────────────────────────────────────────────────────────── listPolls needs no session. Everything else needs a logged-in user (any Discord account), so pass auth. Behind the sitePolls launch flag: while it is hidden for the caller the list is EMPTY (not 403) and a single poll 404s. Draft and scheduled polls are 404 here; developers manage them through adminPolls.

── RESULTS ──────────────────────────────────────────────────────────────── Each poll sets resultsVisibility: always, afterVote (once this user has voted, or the poll closed) or afterClose. The server never sends counts the viewer may not see, so results is null until then - do not compute or guess them on the page.

Percent is a share of VOTES on a single-choice poll and a share of VOTERS on a multi-choice one (so those can sum past 100). The public list is cached up to 15s, so counts there can trail by that much.

Constructors

Methods

  • Cast or change the logged-in user's vote: optionIds is the full pick (1 to maxChoices), replacing any earlier one. A refusal is { status: 400 | 404 | 409 | 429, error: { code } }, code from SitePollErrorCode. Re-sending the same pick is not an error even when changes are locked. 10/minute.

    Parameters

    • __namedParameters: {
          auth: string;
          optionIds: string[];
          pollId: string;
      }
      • auth: string
      • optionIds: string[]
      • pollId: string

    Returns Promise<WebResponse<SitePollView>>