This commit is contained in:
cloudwithax 2023-08-08 16:28:20 -04:00
commit 7eca4724da
3 changed files with 32 additions and 12 deletions

View File

@ -11,29 +11,29 @@ repos:
- id: requirements-txt-fixer - id: requirements-txt-fixer
- id: trailing-whitespace - id: trailing-whitespace
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 23.3.0 rev: 23.7.0
hooks: hooks:
- id: black - id: black
language_version: python3.11 language_version: python3.11
- repo: https://github.com/asottile/blacken-docs - repo: https://github.com/asottile/blacken-docs
rev: 1.13.0 rev: 1.15.0
hooks: hooks:
- id: blacken-docs - id: blacken-docs
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v3.4.0 rev: v3.10.1
hooks: hooks:
- id: pyupgrade - id: pyupgrade
args: [--py37-plus, --keep-runtime-typing] args: [--py37-plus, --keep-runtime-typing]
- repo: https://github.com/asottile/reorder-python-imports - repo: https://github.com/asottile/reorder-python-imports
rev: v3.9.0 rev: v3.10.0
hooks: hooks:
- id: reorder-python-imports - id: reorder-python-imports
- repo: https://github.com/asottile/add-trailing-comma - repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0 rev: v3.0.1
hooks: hooks:
- id: add-trailing-comma - id: add-trailing-comma
- repo: https://github.com/hadialqattan/pycln - repo: https://github.com/hadialqattan/pycln
rev: v2.1.3 rev: v2.2.1
hooks: hooks:
- id: pycln - id: pycln

View File

@ -414,7 +414,10 @@ class Player(VoiceProtocol):
return await self._node.build_track(identifier, ctx=ctx) return await self._node.build_track(identifier, ctx=ctx)
async def get_recommendations( 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]]: ) -> Optional[Union[List[Track], Playlist]]:
""" """
Gets recommendations from either YouTube or Spotify. Gets recommendations from either YouTube or Spotify.
@ -424,7 +427,12 @@ class Player(VoiceProtocol):
return await self._node.get_recommendations(track=track, ctx=ctx) return await self._node.get_recommendations(track=track, ctx=ctx)
async def connect( 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: ) -> None:
await self.guild.change_voice_state( await self.guild.change_voice_state(
channel=self.channel, channel=self.channel,
@ -475,7 +483,12 @@ class Player(VoiceProtocol):
self._log.debug("Player has been destroyed.") self._log.debug("Player has been destroyed.")
async def play( 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: ) -> Track:
"""Plays a track. If a Spotify track is passed in, it will be handled accordingly.""" """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 return self._filters
async def edit_filter( 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: ) -> Filters:
"""Edits a filter from the player using its filter tag and a new filter of the same type. """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. The filter to be replaced must have the same tag as the one you are replacing it with.

View File

@ -447,7 +447,7 @@ class Node:
"""Takes a guild ID as a parameter. Returns a pomice Player object or None.""" """Takes a guild ID as a parameter. Returns a pomice Player object or None."""
return self._players.get(guild_id, 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.""" """Initiates a connection with a Lavalink node and adds it to the node pool."""
await self._bot.wait_until_ready() await self._bot.wait_until_ready()
@ -836,7 +836,10 @@ class Node:
) )
async def get_recommendations( 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]]: ) -> Optional[Union[List[Track], Playlist]]:
""" """
Gets recommendations from either YouTube or Spotify. Gets recommendations from either YouTube or Spotify.