diff --git a/discord/errors.py b/discord/errors.py index 418e4b5abe..852c0462b7 100644 --- a/discord/errors.py +++ b/discord/errors.py @@ -56,7 +56,7 @@ class DiscordException(Exception): - """Base exception class for Pycord + """Base exception class for pycord Ideally speaking, this could be caught to handle any exceptions raised from this library. """ diff --git a/discord/utils.py b/discord/utils.py index 19320f6de8..4360b77a10 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -61,8 +61,7 @@ import types import warnings -from .errors import InvalidArgument, NotFound -from .guild import Guild +from .errors import InvalidArgument try: import orjson @@ -449,15 +448,6 @@ def get(iterable: Iterable[T], **attrs: Any) -> Optional[T]: return elem return None -async def get_or_fetch(guild: Guild, type: str, id: int): - getter = getattr(guild, f'get_{type}')(id) - if getter is None: - try: - getter = await getattr(guild, f'fetch_{type}')(id) - except NotFound: - raise NotFound(404, 'HTTP request operation failed.') - return getter - def _unique(iterable: Iterable[T]) -> List[T]: return [x for x in dict.fromkeys(iterable)]