@@ -2,6 +2,7 @@ from enum import Enum
22from typing import Awaitable , Coroutine , List , Literal , Optional , Type , TypeVar , Union , overload
33
44from interactions .client .bot import Client
5+
56from ..api .http .client import HTTPClient
67from ..api .models .channel import Channel
78from ..api .models .guild import Guild
@@ -21,10 +22,10 @@ class Force(str, Enum):
2122 """
2223 An enum representing the force methods for the get method
2324 """
25+
2426 CACHE : str
2527 HTTP : str
2628
27-
2829# API-object related
2930
3031# with http force
@@ -35,17 +36,16 @@ def get(
3536 obj : Type [_SA ],
3637 * ,
3738 object_id : int ,
38- force : Optional [Literal ["http" , Force .HTTP ]] = None
39+ force : Optional [Literal ["http" , Force .HTTP ]] = None ,
3940) -> Awaitable [_SA ]: ...
40-
4141@overload
4242def get (
4343 client : Client ,
4444 obj : Type [_MA ],
4545 * ,
4646 parent_id : int ,
4747 object_id : int ,
48- force : Optional [Literal ["http" , Force .HTTP ]] = None
48+ force : Optional [Literal ["http" , Force .HTTP ]] = None ,
4949) -> Awaitable [_MA ]: ...
5050
5151# list of objects
@@ -55,57 +55,65 @@ def get(
5555 obj : Type [List [_SA ]],
5656 * ,
5757 object_ids : List [int ],
58- force : Optional [Literal ["http" , Force .HTTP ]] = None
58+ force : Optional [Literal ["http" , Force .HTTP ]] = None ,
5959) -> Awaitable [List [_SA ]]: ...
60-
6160@overload
6261def get (
6362 client : Client ,
6463 obj : Type [List [_MA ]],
6564 * ,
6665 parent_id : int ,
6766 object_ids : List [int ],
68- force : Optional [Literal ["http" , Force .HTTP ]] = None
67+ force : Optional [Literal ["http" , Force .HTTP ]] = None ,
6968) -> Awaitable [List [_MA ]]: ...
7069
7170# with cache force
7271@overload
73- def get (client : Client , obj : Type [_SA ], * , object_id : int , force : Literal ["cache" , Force .CACHE ]) -> Optional [_SA ]: ...
74-
72+ def get (
73+ client : Client , obj : Type [_SA ], * , object_id : int , force : Literal ["cache" , Force .CACHE ]
74+ ) -> Optional [_SA ]: ...
7575@overload
7676def get (
77- client : Client , obj : Type [_MA ], * , parent_id : int , object_id : int , force : Literal ["cache" , Force .CACHE ]
77+ client : Client ,
78+ obj : Type [_MA ],
79+ * ,
80+ parent_id : int ,
81+ object_id : int ,
82+ force : Literal ["cache" , Force .CACHE ],
7883) -> Optional [_MA ]: ...
7984
8085# list of objects
8186@overload
8287def get (
83- client : Client , obj : Type [List [_SA ]], * , object_ids : List [int ], force : Literal ["cache" , Force .CACHE ]
88+ client : Client ,
89+ obj : Type [List [_SA ]],
90+ * ,
91+ object_ids : List [int ],
92+ force : Literal ["cache" , Force .CACHE ],
8493) -> List [Optional [_SA ]]: ...
85-
8694@overload
8795def get (
8896 client : Client ,
8997 obj : Type [List [_MA ]],
9098 * ,
9199 parent_id : int ,
92100 object_ids : List [int ],
93- force : Literal ["cache" , Force .CACHE ]
101+ force : Literal ["cache" , Force .CACHE ],
94102) -> List [Optional [_MA ]]: ...
95103
96104# Having a not-overloaded definition stops showing a warning/complaint from the IDE if wrong arguments are put in,
97105# so we'll leave that out
98106
99107def _get_cache (
100108 _object : Type [_T ], client : Client , kwarg_name : str , _list : bool = False , ** kwargs
101- ) -> Union [Optional [_T ], List [Optional [_T ]]]:...
109+ ) -> Union [Optional [_T ], List [Optional [_T ]]]: ...
102110async def _return_cache (
103111 obj : Union [Optional [_T ], List [Optional [_T ]]]
104- ) -> Union [Optional [_T ], List [Optional [_T ]]]:...
112+ ) -> Union [Optional [_T ], List [Optional [_T ]]]: ...
105113async def _http_request (
106114 obj : Type [_T ],
107115 http : HTTPClient ,
108116 request : Union [Coroutine , List [Union [_T , Coroutine ]], List [Coroutine ]] = None ,
109117 _name : str = None ,
110118 ** kwargs ,
111- ) -> Union [_T , List [_T ]]:...
119+ ) -> Union [_T , List [_T ]]: ...
0 commit comments