-
-
Notifications
You must be signed in to change notification settings - Fork 468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Polls #2408
feat: Polls #2408
Conversation
@commands.slash_command(name="poll")
async def poll(self, ctx, question: Option(str), option1: Option(str), option2: Option(str)):
"""Start a poll"""
poll = Poll(question=question, answers=[option1, option2], duration=300, allow_multiselect=False)
await ctx.send(poll=poll)
|
these are fixed in the latest version. Note that question should be a full PollMedia object (e.g. |
I still have both of these errors on 9423a8a, and I did change it to use PollMedia |
Try now? Also if this back and forth goes longer, may be better to tag me on discord |
As the main PR is merged, this is effectively ready
Now for the creation of polls, I wasn't entirely sure on the best approach.
But
Due to the extensiveness of the polls API, I feel this is one of those instances where it's beneficial to add extra convenience for the user instead of sticking to it religiously.
If you are able to, please stress test this PR and see if the internally cached vote counts are able to keep up with realtime counts on Discord, especially when bouncing between 1-0 votes on specific answers; this part involves manual deletion and creation of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changelog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
documentation suggestions
- fix minor mistakes
- more formal writing
- formatting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs follows standard US English conventions.
AMERICA!! 🦅
Co-authored-by: JustaSqu1d <[email protected]> Signed-off-by: UK <[email protected]>
Co-authored-by: JustaSqu1d <[email protected]> Signed-off-by: UK <[email protected]>
Will test personally, but your testing would still be appreciated (you haven't checked the box in the checklist). |
I have thoroughly tested the PR as of 1 month ago. All of the core functionality works. It does not look like any major changes to functionality were made recently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor grammar/spelling
Co-authored-by: JustaSqu1d <[email protected]> Signed-off-by: Lala Sabathil <[email protected]>
Signed-off-by: Dorukyum <[email protected]>
Signed-off-by: UK <[email protected]> Signed-off-by: Lala Sabathil <[email protected]> Signed-off-by: Dorukyum <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: plun1331 <[email protected]> Co-authored-by: JustaSqu1d <[email protected]> Co-authored-by: Dorukyum <[email protected]> Co-authored-by: Lala Sabathil <[email protected]>
Summary
Implements polls and related features. WIP while the original PR becomes more stable over the experimental phase.
References:
Notes:
ForAfter reconsidering, this wasn't great. ForPoll
andPollAnswer
,PollMedia
is abstracted to its attributes (e.g.Poll.PollMedia.text
is assigned toPoll.question
). An undocumented attribute_media
still remains.__init__
s you can just pass the strings, but otherwise you'd access throughPoll.question.text
, for example.Will work on a new AsyncIterator for answer.usersCompleteInformation
examples, ...).
Checklist
type: ignore
comments were used, a comment is also left explaining why.