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:
DA344
2024-05-10 12:14:12 +02:00
committed by GitHub
parent a1206dfde8
commit e43bd8692c
19 changed files with 1097 additions and 1 deletions

View File

@ -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