Site polls - the developers' side. Every method is developer-only (403 otherwise) and NOT behind the sitePolls flag, so polls can be drafted before launch.

Publishing with postToDiscord posts the poll to the site-updates Discord webhook ONCE (only if the server has one configured); postedToDiscordAt says when. Unpublishing and publishing again never posts twice.

Constructors

Methods

  • Delete a poll with its options and votes.

    Parameters

    • __namedParameters: {
          auth: string;
          pollId: string;
      }
      • auth: string
      • pollId: string

    Returns Promise<WebResponse<{
        pollId: string;
    }>>

  • Edit a poll; send only what changes. options REPLACES the list: send an existing option's optionId to keep it (and its votes). Removing an option that has votes is { status: 409, error: { code: 'option_has_votes', optionIds } } unless force: true, which deletes them.

    Parameters

    Returns Promise<WebResponse<AdminSitePoll>>