File tree Expand file tree Collapse file tree 2 files changed +2
-12
lines changed Expand file tree Collapse file tree 2 files changed +2
-12
lines changed Original file line number Diff line number Diff line change 56
56
57
57
58
58
class DiscordException (Exception ):
59
- """Base exception class for Pycord
59
+ """Base exception class for pycord
60
60
61
61
Ideally speaking, this could be caught to handle any exceptions raised from this library.
62
62
"""
Original file line number Diff line number Diff line change 61
61
import types
62
62
import warnings
63
63
64
- from .errors import InvalidArgument , NotFound
65
- from .guild import Guild
64
+ from .errors import InvalidArgument
66
65
67
66
try :
68
67
import orjson
@@ -449,15 +448,6 @@ def get(iterable: Iterable[T], **attrs: Any) -> Optional[T]:
449
448
return elem
450
449
return None
451
450
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
-
461
451
462
452
def _unique (iterable : Iterable [T ]) -> List [T ]:
463
453
return [x for x in dict .fromkeys (iterable )]
You can’t perform that action at this time.
0 commit comments