diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b8f7598..d1e6acb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,29 +11,29 @@ repos: - id: requirements-txt-fixer - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 23.7.0 hooks: - id: black language_version: python3.11 - repo: https://github.com/asottile/blacken-docs - rev: 1.13.0 + rev: 1.15.0 hooks: - id: blacken-docs - repo: https://github.com/asottile/pyupgrade - rev: v3.4.0 + rev: v3.10.1 hooks: - id: pyupgrade args: [--py37-plus, --keep-runtime-typing] - repo: https://github.com/asottile/reorder-python-imports - rev: v3.9.0 + rev: v3.10.0 hooks: - id: reorder-python-imports - repo: https://github.com/asottile/add-trailing-comma - rev: v2.4.0 + rev: v3.0.1 hooks: - id: add-trailing-comma - repo: https://github.com/hadialqattan/pycln - rev: v2.1.3 + rev: v2.2.1 hooks: - id: pycln diff --git a/pomice/player.py b/pomice/player.py index da01696..c1f3436 100644 --- a/pomice/player.py +++ b/pomice/player.py @@ -414,7 +414,10 @@ class Player(VoiceProtocol): return await self._node.build_track(identifier, ctx=ctx) async def get_recommendations( - self, *, track: Track, ctx: Optional[commands.Context] = None + self, + *, + track: Track, + ctx: Optional[commands.Context] = None, ) -> Optional[Union[List[Track], Playlist]]: """ Gets recommendations from either YouTube or Spotify. @@ -424,7 +427,12 @@ class Player(VoiceProtocol): return await self._node.get_recommendations(track=track, ctx=ctx) async def connect( - self, *, timeout: float, reconnect: bool, self_deaf: bool = False, self_mute: bool = False + self, + *, + timeout: float, + reconnect: bool, + self_deaf: bool = False, + self_mute: bool = False, ) -> None: await self.guild.change_voice_state( channel=self.channel, @@ -475,7 +483,12 @@ class Player(VoiceProtocol): self._log.debug("Player has been destroyed.") async def play( - self, track: Track, *, start: int = 0, end: int = 0, ignore_if_playing: bool = False + self, + track: Track, + *, + start: int = 0, + end: int = 0, + ignore_if_playing: bool = False, ) -> Track: """Plays a track. If a Spotify track is passed in, it will be handled accordingly.""" @@ -669,7 +682,11 @@ class Player(VoiceProtocol): return self._filters async def edit_filter( - self, *, filter_tag: str, edited_filter: Filter, fast_apply: bool = False + self, + *, + filter_tag: str, + edited_filter: Filter, + fast_apply: bool = False, ) -> Filters: """Edits a filter from the player using its filter tag and a new filter of the same type. The filter to be replaced must have the same tag as the one you are replacing it with. diff --git a/pomice/pool.py b/pomice/pool.py index 107c64b..817909c 100644 --- a/pomice/pool.py +++ b/pomice/pool.py @@ -447,7 +447,7 @@ class Node: """Takes a guild ID as a parameter. Returns a pomice Player object or None.""" return self._players.get(guild_id, None) - async def connect(self, *, reconnect: bool = False) -> "Node": + async def connect(self, *, reconnect: bool = False) -> Node: """Initiates a connection with a Lavalink node and adds it to the node pool.""" await self._bot.wait_until_ready() @@ -836,7 +836,10 @@ class Node: ) async def get_recommendations( - self, *, track: Track, ctx: Optional[commands.Context] = None + self, + *, + track: Track, + ctx: Optional[commands.Context] = None, ) -> Optional[Union[List[Track], Playlist]]: """ Gets recommendations from either YouTube or Spotify.