impr: Optimize the number of function calls

This commit is contained in:
Lemon4ksan
2025-01-10 13:48:20 +03:00
parent c521d32bc8
commit bcaba81f41
4 changed files with 131 additions and 69 deletions

View File

@@ -1,18 +1,20 @@
from typing import TypedDict, Any
class Guild(TypedDict):
next_tracks_list: list[dict[str, Any]]
previous_tracks_list: list[dict[str, Any]]
class Guild(TypedDict, total=False):
next_tracks: list[dict[str, Any]]
previous_tracks: list[dict[str, Any]]
current_track: dict[str, Any] | None
current_player: int | None
is_stopped: bool
allow_explicit: bool
allow_menu: bool
class ExplicitGuild(TypedDict):
_id: int
next_tracks_list: list[dict[str, Any]]
previous_tracks_list: list[dict[str, Any]]
next_tracks: list[dict[str, Any]]
previous_tracks: list[dict[str, Any]]
current_track: dict[str, Any] | None
current_player: int | None
is_stopped: bool # Prevents the `after` callback of play_track
allow_explicit: bool
allow_menu: bool # Is /toggle mnu command available
allow_menu: bool # Is /toggle menu command available