Skip to main content
Use poll() to send a poll with a title and a list of choices. Each choice can be a plain string or a object. Use option() when you want the explicit form.
import { poll, option } from "spectrum-ts";

// Variadic strings
await space.send(poll("Lunch?", "Pizza", "Sushi", "Tacos"));

// Or an array, optionally using option() for clarity
await space.send(poll("Lunch?", [
  option("Pizza"),
  option("Sushi"),
  option("Tacos"),
]));
Poll responses arrive as poll_option content. See Messages for narrowing on incoming votes.