mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-06 09:56:09 +00:00
Add support for Polls
Co-authored-by: owocado <24418520+owocado@users.noreply.github.com> Co-authored-by: Josh <8677174+bijij@users.noreply.github.com> Co-authored-by: Trevor Flahardy <75498301+trevorflahardy@users.noreply.github.com>
This commit is contained in:
@ -107,6 +107,7 @@ if TYPE_CHECKING:
|
||||
RawThreadMembersUpdate,
|
||||
RawThreadUpdateEvent,
|
||||
RawTypingEvent,
|
||||
RawPollVoteActionEvent,
|
||||
)
|
||||
from .reaction import Reaction
|
||||
from .role import Role
|
||||
@ -116,6 +117,7 @@ if TYPE_CHECKING:
|
||||
from .ui.item import Item
|
||||
from .voice_client import VoiceProtocol
|
||||
from .audit_logs import AuditLogEntry
|
||||
from .poll import PollAnswer
|
||||
|
||||
|
||||
# fmt: off
|
||||
@ -1815,6 +1817,30 @@ class Client:
|
||||
) -> Tuple[Member, VoiceState, VoiceState]:
|
||||
...
|
||||
|
||||
# Polls
|
||||
|
||||
@overload
|
||||
async def wait_for(
|
||||
self,
|
||||
event: Literal['poll_vote_add', 'poll_vote_remove'],
|
||||
/,
|
||||
*,
|
||||
check: Optional[Callable[[Union[User, Member], PollAnswer], bool]] = None,
|
||||
timeout: Optional[float] = None,
|
||||
) -> Tuple[Union[User, Member], PollAnswer]:
|
||||
...
|
||||
|
||||
@overload
|
||||
async def wait_for(
|
||||
self,
|
||||
event: Literal['raw_poll_vote_add', 'raw_poll_vote_remove'],
|
||||
/,
|
||||
*,
|
||||
check: Optional[Callable[[RawPollVoteActionEvent], bool]] = None,
|
||||
timeout: Optional[float] = None,
|
||||
) -> RawPollVoteActionEvent:
|
||||
...
|
||||
|
||||
# Commands
|
||||
|
||||
@overload
|
||||
|
Reference in New Issue
Block a user