Skip to content
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

Implement Polls #1922

Open
wants to merge 80 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
1ed6fcf
Initial commit on implementing polls
PythonTryHard May 19, 2024
2c53e90
Towncrier chore
PythonTryHard May 19, 2024
89088f1
New poll endpoints
PythonTryHard May 19, 2024
2888d76
Ensure route naming consistency
PythonTryHard May 20, 2024
f31effb
Basic implementation of poll-related classes
PythonTryHard May 20, 2024
36e5963
I forgor to format my code
PythonTryHard May 20, 2024
b7979c4
Poll-specific events
PythonTryHard May 20, 2024
a32ac57
Only import hikari.Emoji on type checking
PythonTryHard May 20, 2024
153fab3
Remove erroneous `__slots__` from PollResult
PythonTryHard May 20, 2024
3daae57
Integrate poll classes and events into hikari
PythonTryHard May 20, 2024
aaab4c4
Implement poll in EntityFactory and REST
PythonTryHard May 27, 2024
4be409f
Update typing stub
PythonTryHard May 27, 2024
8d3220b
Apparently `Emoji` needs to be imported
PythonTryHard May 27, 2024
a330fcd
added `_serialize_poll_media()`
mplatypus May 27, 2024
ff5413e
Removal of counter
mplatypus May 27, 2024
64d7b33
Merge pull request #1 from MPlatypus/fix/polls
PythonTryHard May 27, 2024
f7f58b7
Credit's where credit's due
PythonTryHard May 27, 2024
a5dbfe7
Throw error on adding answer with existing ID
PythonTryHard May 27, 2024
a6ba51e
Apparently we don't need to set _answer to None
PythonTryHard May 27, 2024
ea9de9e
Docstring, dammit
PythonTryHard May 27, 2024
a7fa5a6
Apply suggestions from code review
PythonTryHard May 27, 2024
e7768d3
`Emoji` is now `emojis.Emoji`
PythonTryHard May 28, 2024
65c333f
`PollObject` is now `Poll`
PythonTryHard May 28, 2024
6102e92
Correct `duration` key in `serialize_poll`
PythonTryHard May 28, 2024
2347199
Finalize a7fa5a6b on de-underscoring and `.get()`
PythonTryHard May 28, 2024
b2730be
Change event name for consistency
PythonTryHard May 28, 2024
0d2de42
I forgor to update `__all__`
PythonTryHard May 28, 2024
b5bc835
Dav please
PythonTryHard May 28, 2024
cfb4446
Use UNDEFINED for nullable guild in poll events
PythonTryHard May 28, 2024
9fc84a9
Nox
PythonTryHard May 28, 2024
e6d642f
Implement poll events in EventFactory
PythonTryHard May 28, 2024
7fe8a12
Correct fallback value for guild_id.
PythonTryHard May 28, 2024
405458d
`PollCreate` is now `PollBuilder`
PythonTryHard May 28, 2024
313d673
....shit
PythonTryHard May 28, 2024
fd21d87
fixed naming of poll events in event manager
mplatypus May 28, 2024
6a4c892
added poll vote add/remove intents
mplatypus May 28, 2024
6f0b79f
forgor nox
mplatypus May 28, 2024
bf34490
added extra intents.
mplatypus May 28, 2024
543d20c
Fixed PollCreate to PollBuilder
mplatypus May 28, 2024
917e35e
fixed emojis, and answer handling.
mplatypus May 28, 2024
515325e
Fixed naming
mplatypus May 28, 2024
1517482
fixed naming and docs
mplatypus May 28, 2024
d6fbf67
Migrate remnant `PollCreate`
PythonTryHard Jul 10, 2024
e911c06
Inline the two `_deserialize`
PythonTryHard Jul 10, 2024
629a1bb
Inline _serialize_poll_partial_emoji
PythonTryHard Jul 10, 2024
c846391
Merge pull request #4 from mplatypus/polls
PythonTryHard Jul 10, 2024
9e8a50c
Minor improvement to docstrings
PythonTryHard Jul 10, 2024
1e05101
What the hell Platy?
PythonTryHard Jul 10, 2024
001e2e2
Add missing `poll_events` import
PythonTryHard Jul 10, 2024
aaed77e
added poll endpoints
mplatypus Jul 10, 2024
46a425c
ruff formatting + changed to sequence
mplatypus Jul 10, 2024
38dd771
Nox format
PythonTryHard Jul 10, 2024
1dc17f4
Resolve typing conflict of `_answer` field
PythonTryHard Jul 10, 2024
13ef0cd
added some more tests.
mplatypus Jul 10, 2024
9d8cb17
Rework Poll events
PythonTryHard Jul 10, 2024
064baed
fixed failing tests.
mplatypus Jul 10, 2024
43fee96
Merge pull request #5 from mplatypus/polls
PythonTryHard Jul 10, 2024
bc65d79
Merge remote-tracking branch 'fork/master' into polls
PythonTryHard Jul 10, 2024
add6bf5
Appease flake8
PythonTryHard Jul 10, 2024
fbe5d1a
Appease mypy
PythonTryHard Jul 10, 2024
700521e
Correct docstring after renaming
PythonTryHard Jul 10, 2024
250cb47
Edit message endpoint doesn't support polls
PythonTryHard Jul 10, 2024
bfd338e
Improve names and docstrings
PythonTryHard Jul 10, 2024
385e62d
finished most tests.
mplatypus Jul 11, 2024
db85774
Merge pull request #6 from mplatypus/polls
PythonTryHard Jul 11, 2024
1f6db34
Merge remote-tracking branch 'fork/master' into polls
PythonTryHard Jul 11, 2024
51fe4e4
Correct edit_message tests
PythonTryHard Jul 11, 2024
eb41493
Correct poll answer payload extraction
PythonTryHard Jul 11, 2024
25ce6f2
Correct event name in test
PythonTryHard Jul 11, 2024
afeeebf
...missed some
PythonTryHard Jul 11, 2024
3440a15
Fix test_fetch_poll_voter occasionally not working
PythonTryHard Jul 11, 2024
9b33958
added missing tests.
mplatypus Aug 1, 2024
46d9cbc
Added tests for polls
mplatypus Aug 1, 2024
69c0e6c
Merge pull request #7 from mplatypus/polls
PythonTryHard Aug 10, 2024
9f0e4c8
Remove leftover inlined method
PythonTryHard Jul 12, 2024
ff06143
Update copyright holder
PythonTryHard Aug 7, 2024
466af5b
Fix failing poll tests
PythonTryHard Aug 10, 2024
f2131f6
I guess this is fine
PythonTryHard Aug 10, 2024
a751cc4
I did a dumb
PythonTryHard Aug 10, 2024
2011519
Merge remote-tracking branch 'origin/master' into polls
PythonTryHard Aug 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions hikari/internal/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ def compile_to_file(
POST_CHANNEL_WEBHOOKS: typing.Final[Route] = Route(POST, "/channels/{channel}/webhooks")
GET_CHANNEL_WEBHOOKS: typing.Final[Route] = Route(GET, "/channels/{channel}/webhooks")

# Polls
GET_ANSWER_VOTERS: typing.Final[Route] = Route(GET, "/channels/{channel}/polls/{message}/answer/{answer}")
END_POLL: typing.Final[Route] = Route(POST, "/channels/{channel}/polls/{message}/expire")
PythonTryHard marked this conversation as resolved.
Show resolved Hide resolved

# Reactions
GET_REACTIONS: typing.Final[Route] = Route(GET, "/channels/{channel}/messages/{message}/reactions/{emoji}")
DELETE_ALL_REACTIONS: typing.Final[Route] = Route(DELETE, "/channels/{channel}/messages/{message}/reactions")
Expand Down
Loading