@@ -2,6 +2,7 @@ from enum import Enum
2
2
from typing import Awaitable , Coroutine , List , Literal , Optional , Type , TypeVar , Union , overload
3
3
4
4
from interactions .client .bot import Client
5
+
5
6
from ..api .http .client import HTTPClient
6
7
from ..api .models .channel import Channel
7
8
from ..api .models .guild import Guild
@@ -21,10 +22,10 @@ class Force(str, Enum):
21
22
"""
22
23
An enum representing the force methods for the get method
23
24
"""
25
+
24
26
CACHE : str
25
27
HTTP : str
26
28
27
-
28
29
# API-object related
29
30
30
31
# with http force
@@ -35,17 +36,16 @@ def get(
35
36
obj : Type [_SA ],
36
37
* ,
37
38
object_id : int ,
38
- force : Optional [Literal ["http" , Force .HTTP ]] = None
39
+ force : Optional [Literal ["http" , Force .HTTP ]] = None ,
39
40
) -> Awaitable [_SA ]: ...
40
-
41
41
@overload
42
42
def get (
43
43
client : Client ,
44
44
obj : Type [_MA ],
45
45
* ,
46
46
parent_id : int ,
47
47
object_id : int ,
48
- force : Optional [Literal ["http" , Force .HTTP ]] = None
48
+ force : Optional [Literal ["http" , Force .HTTP ]] = None ,
49
49
) -> Awaitable [_MA ]: ...
50
50
51
51
# list of objects
@@ -55,57 +55,65 @@ def get(
55
55
obj : Type [List [_SA ]],
56
56
* ,
57
57
object_ids : List [int ],
58
- force : Optional [Literal ["http" , Force .HTTP ]] = None
58
+ force : Optional [Literal ["http" , Force .HTTP ]] = None ,
59
59
) -> Awaitable [List [_SA ]]: ...
60
-
61
60
@overload
62
61
def get (
63
62
client : Client ,
64
63
obj : Type [List [_MA ]],
65
64
* ,
66
65
parent_id : int ,
67
66
object_ids : List [int ],
68
- force : Optional [Literal ["http" , Force .HTTP ]] = None
67
+ force : Optional [Literal ["http" , Force .HTTP ]] = None ,
69
68
) -> Awaitable [List [_MA ]]: ...
70
69
71
70
# with cache force
72
71
@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 ]: ...
75
75
@overload
76
76
def 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 ],
78
83
) -> Optional [_MA ]: ...
79
84
80
85
# list of objects
81
86
@overload
82
87
def 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 ],
84
93
) -> List [Optional [_SA ]]: ...
85
-
86
94
@overload
87
95
def get (
88
96
client : Client ,
89
97
obj : Type [List [_MA ]],
90
98
* ,
91
99
parent_id : int ,
92
100
object_ids : List [int ],
93
- force : Literal ["cache" , Force .CACHE ]
101
+ force : Literal ["cache" , Force .CACHE ],
94
102
) -> List [Optional [_MA ]]: ...
95
103
96
104
# Having a not-overloaded definition stops showing a warning/complaint from the IDE if wrong arguments are put in,
97
105
# so we'll leave that out
98
106
99
107
def _get_cache (
100
108
_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 ]]]: ...
102
110
async def _return_cache (
103
111
obj : Union [Optional [_T ], List [Optional [_T ]]]
104
- ) -> Union [Optional [_T ], List [Optional [_T ]]]:...
112
+ ) -> Union [Optional [_T ], List [Optional [_T ]]]: ...
105
113
async def _http_request (
106
114
obj : Type [_T ],
107
115
http : HTTPClient ,
108
116
request : Union [Coroutine , List [Union [_T , Coroutine ]], List [Coroutine ]] = None ,
109
117
_name : str = None ,
110
118
** kwargs ,
111
- ) -> Union [_T , List [_T ]]:...
119
+ ) -> Union [_T , List [_T ]]: ...
0 commit comments