23
23
from __future__ import annotations
24
24
25
25
import datetime
26
- from typing import List , Optional , Sequence , overload
26
+ from typing import List , Literal , Optional , Sequence , overload
27
27
28
28
import aiohttp
29
29
@@ -174,7 +174,15 @@ async def delete_pastes(self, paste_ids: List[str], /) -> None:
174
174
"""
175
175
await self .http .delete_pastes (paste_ids = paste_ids )
176
176
177
- async def get_paste (self , paste_id : str , * , password : Optional [str ] = None ) -> Paste :
177
+ @overload
178
+ async def get_paste (self , paste_id : str , * , password : Optional [str ] = ..., raw : Literal [False ]) -> Paste :
179
+ ...
180
+
181
+ @overload
182
+ async def get_paste (self , paste_id : str , * , password : Optional [str ] = ..., raw : Literal [True ]) -> list [str ]:
183
+ ...
184
+
185
+ async def get_paste (self , paste_id : str , * , password : Optional [str ] = None , raw : bool = False ) -> Paste | list [str ]:
178
186
"""|coro|
179
187
180
188
Fetch a paste.
@@ -187,6 +195,8 @@ async def get_paste(self, paste_id: str, *, password: Optional[str] = None) -> P
187
195
The password of the paste, if any.
188
196
"""
189
197
data = await self .http .get_paste (paste_id = paste_id , password = password )
198
+ if raw :
199
+ return [item ["content" ] for item in data ["files" ]]
190
200
return Paste .from_data (data )
191
201
192
202
@require_authentication
0 commit comments