mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-15 02:09:49 +00:00
Make Asset.with_ functions positional only
This commit is contained in:
parent
d9adf4d35d
commit
f9bccabac5
@ -311,7 +311,7 @@ class Asset(AssetMixin):
|
|||||||
url = str(url)
|
url = str(url)
|
||||||
return Asset(state=self._state, url=url, key=self._key, animated=self._animated)
|
return Asset(state=self._state, url=url, key=self._key, animated=self._animated)
|
||||||
|
|
||||||
def with_size(self, size: int) -> Asset:
|
def with_size(self, size: int, /) -> Asset:
|
||||||
"""Returns a new asset with the specified size.
|
"""Returns a new asset with the specified size.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
@ -335,7 +335,7 @@ class Asset(AssetMixin):
|
|||||||
url = str(yarl.URL(self._url).with_query(size=size))
|
url = str(yarl.URL(self._url).with_query(size=size))
|
||||||
return Asset(state=self._state, url=url, key=self._key, animated=self._animated)
|
return Asset(state=self._state, url=url, key=self._key, animated=self._animated)
|
||||||
|
|
||||||
def with_format(self, format: ValidAssetFormatTypes) -> Asset:
|
def with_format(self, format: ValidAssetFormatTypes, /) -> Asset:
|
||||||
"""Returns a new asset with the specified format.
|
"""Returns a new asset with the specified format.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
@ -366,7 +366,7 @@ class Asset(AssetMixin):
|
|||||||
url = str(url.with_path(f'{path}.{format}').with_query(url.raw_query_string))
|
url = str(url.with_path(f'{path}.{format}').with_query(url.raw_query_string))
|
||||||
return Asset(state=self._state, url=url, key=self._key, animated=self._animated)
|
return Asset(state=self._state, url=url, key=self._key, animated=self._animated)
|
||||||
|
|
||||||
def with_static_format(self, format: ValidStaticFormatTypes) -> Asset:
|
def with_static_format(self, format: ValidStaticFormatTypes, /) -> Asset:
|
||||||
"""Returns a new asset with the specified static format.
|
"""Returns a new asset with the specified static format.
|
||||||
|
|
||||||
This only changes the format if the underlying asset is
|
This only changes the format if the underlying asset is
|
||||||
|
Loading…
x
Reference in New Issue
Block a user