feat: Add vote functionality.

This commit is contained in:
Lemon4ksan
2025-01-22 19:30:37 +03:00
parent 18ff925236
commit 859d60de35
8 changed files with 278 additions and 152 deletions

View File

@@ -1,4 +1,11 @@
from typing import TypedDict, Any
from typing import TypedDict, Literal, Any
class MessageVotes(TypedDict):
positive_votes: list[int]
negative_votes: list[int]
total_members: int
action: Literal['next', 'add_track', 'add_album', 'add_artist', 'add_playlist']
vote_content: dict[str, Any] | list[dict[str, Any]] | None
class Guild(TypedDict, total=False):
next_tracks: list[dict[str, Any]]
@@ -8,7 +15,6 @@ class Guild(TypedDict, total=False):
is_stopped: bool
allow_explicit: bool
always_allow_menu: bool
vote_add: bool
vote_next_track: bool
vote_add_track: bool
vote_add_album: bool
@@ -16,6 +22,7 @@ class Guild(TypedDict, total=False):
vote_add_playlist: bool
shuffle: bool
repeat: bool
votes: dict[str, MessageVotes]
class ExplicitGuild(TypedDict):
_id: int
@@ -26,11 +33,11 @@ class ExplicitGuild(TypedDict):
is_stopped: bool # Prevents the `after` callback of play_track
allow_explicit: bool
always_allow_menu: bool
vote_add: bool
vote_next_track: bool
vote_add_track: bool
vote_add_album: bool
vote_add_artist: bool
vote_add_playlist: bool
shuffle: bool
repeat: bool
repeat: bool
votes: dict[str, MessageVotes]