Skip to content

Commit cea77e2

Browse files
Revert "Implements a new get_or_fetch feature (#42)" (#43)
This reverts commit ea4b656.
1 parent ea4b656 commit cea77e2

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

discord/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757

5858
class DiscordException(Exception):
59-
"""Base exception class for Pycord
59+
"""Base exception class for pycord
6060
6161
Ideally speaking, this could be caught to handle any exceptions raised from this library.
6262
"""

discord/utils.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@
6161
import types
6262
import warnings
6363

64-
from .errors import InvalidArgument, NotFound
65-
from .guild import Guild
64+
from .errors import InvalidArgument
6665

6766
try:
6867
import orjson
@@ -449,15 +448,6 @@ def get(iterable: Iterable[T], **attrs: Any) -> Optional[T]:
449448
return elem
450449
return None
451450

452-
async def get_or_fetch(guild: Guild, type: str, id: int):
453-
getter = getattr(guild, f'get_{type}')(id)
454-
if getter is None:
455-
try:
456-
getter = await getattr(guild, f'fetch_{type}')(id)
457-
except NotFound:
458-
raise NotFound(404, 'HTTP request operation failed.')
459-
return getter
460-
461451

462452
def _unique(iterable: Iterable[T]) -> List[T]:
463453
return [x for x in dict.fromkeys(iterable)]

0 commit comments

Comments
 (0)