Skip to content

feat: add polls feature#148

Open
ap-1 wants to merge 8 commits into
mainfrom
polls
Open

feat: add polls feature#148
ap-1 wants to merge 8 commits into
mainfrom
polls

Conversation

@ap-1

@ap-1 ap-1 commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Adds /poll command with six subcommands:

  • setup (configure guild polls channel)
  • create (create a poll with up to 10 options, optional multi-select)
  • results (view vote counts)
  • delete (for admins or poll authors to remove polls)
  • close (to manually close the poll before expiry)
  • myvote (check your own vote on an anonymous poll)

Closes https://github.com/ScottyLabs/dalmatian/issues/48

@ap-1 ap-1 requested review from TenType and maybe-yiyi as code owners April 10, 2026 18:44
@ap-1 ap-1 marked this pull request as draft April 10, 2026 18:52
@ap-1 ap-1 self-assigned this Apr 10, 2026
@ap-1 ap-1 marked this pull request as ready for review April 10, 2026 19:35
@maybe-yiyi

maybe-yiyi commented Apr 13, 2026

Copy link
Copy Markdown
Member

just some things, not sure if some are feasible at all

  • Should we have polls autoclose? What if people just want the polls to be open indefinitely?
  • I think the results page should reference the original poll perhaps
    • is there a way to make it so you can see your own vote on anonymous polls? obviously we wouldn't be able to use ephemeral messages for that
  • For me the polls are saying Poll by <@649388957007609879>•Today at 16:21 instead of mentioning the user
  • i think we should put at least rolling counts on the ongoing polls
  • does the poll embed builder just add every single voter to the voting list? it feels like you might hit embed limits on massive polls, and/or it crowds the answer choices
  • what if i want to unvote from a poll

@ap-1

ap-1 commented Apr 13, 2026

Copy link
Copy Markdown
Contributor Author

just some things, not sure if some are feasible at all

* Should we have polls autoclose? What if people just want the polls to be open indefinitely?

* I think the results page should reference the original poll perhaps
  
  * is there a way to make it so you can see your own vote on anonymous polls? obviously we wouldn't be able to use ephemeral messages for that

* For me the polls are saying `Poll by <@649388957007609879>•Today at 16:21` instead of mentioning the user

* i think we should put at least rolling counts on the ongoing polls

* does the poll embed builder just add every single voter to the voting list? it feels like you might hit embed limits on massive polls, and/or it crowds the answer choices

* what if i want to unvote from a poll
  • made duration optional so there's no expiry by default
  • results embed links to the original poll message
  • /poll myvote to check your vote on anonymous polls
  • "Poll by" moved from footer to description
  • rolling vote counts shown on ongoing poll embeds now
  • voter list capped at 10 with "+ X more"
  • allows unvoting now by removing the minimum selected values

@maybe-yiyi

Copy link
Copy Markdown
Member

wait how do you unvote
it doesn't seem like i'm able to send a selection with 0 options selected or anything

@ap-1

ap-1 commented Apr 13, 2026

Copy link
Copy Markdown
Contributor Author

nevermind seems like that's not a thing, i just added an unvote button instead

@maybe-yiyi maybe-yiyi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

besides these things lgtm

didn't test attempting to delete polls without being the author, but the code looks correct.

  • perhaps eventually we can whitelist/blacklist multiple roles
  • maybe we consider whether it's necessary to enumerate the poll options, since we aren't voting using the enumeration nor does it really matter for poll results?

Comment thread src/commands/poll.ts
Comment thread src/commands/poll.ts
Comment thread src/commands/poll.ts
@ap-1 ap-1 requested a review from maybe-yiyi April 13, 2026 21:59

@maybe-yiyi maybe-yiyi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, thanks!

perhaps @TenType will want to review in terms of design, but it looks good to me.

@TenType TenType left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check this as well tonight, thanks yiyoung!

@TenType TenType left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, some things I think we should change:

  • I'd prefer if we don't show who votes for what by default as it clutters the embed. maybe we can have a button "See voters" that replies with an ephemeral message of voters for each choice
  • for anonymous polls, the number of people who voted for each choice is missing - can we also add the running count there as well?
  • for time-limited polls, let's also show the time remaining via a discord timestamp
  • I think it would be better to use components v2 for creating a poll (similar to how we do reaction redirect setup) than to accept the options via arguments, but this is okay to do in a separate PR

@maybe-yiyi

Copy link
Copy Markdown
Member

Wait does this have ranked choice implemented

@TenType TenType left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the earlier comment

@Gostmeaper Gostmeaper self-assigned this May 3, 2026
@Gostmeaper Gostmeaper removed their assignment May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Polls command

4 participants