20
20
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
SOFTWARE.
22
22
"""
23
- from __future__ import annotations
24
-
25
23
import asyncio
26
24
from typing import TYPE_CHECKING , Any
27
25
28
26
import discord
29
27
from discord import ui # shortcut because I'm lazy
30
- from discord .ext import commands
28
+ from discord .ext . commands import CommandError , Paginator as _Paginator
31
29
from discord .utils import MISSING
32
-
33
30
from core import Context
31
+ from typing_extensions import Self
34
32
35
-
36
- if TYPE_CHECKING :
37
- from typing_extensions import Self
38
-
39
- __all__ = (
40
- "CannotPaginate" ,
41
- "Pager" ,
42
- "KVPager" ,
43
- "TextPager" ,
44
- )
33
+ __all__ = ("CannotPaginate" , "Pager" , "KVPager" , "TextPager" )
45
34
46
35
47
- class CannotPaginate (commands . CommandError ):
36
+ class CannotPaginate (CommandError ):
48
37
pass
49
38
50
39
@@ -120,7 +109,7 @@ def get_page(self, page: int) -> list[Any]:
120
109
return self .entries [base : base + self .per_page ]
121
110
122
111
def get_content (self , entry : Any , page : int , * , first : bool = False ) -> str :
123
- raise NotImplementedError
112
+ return None
124
113
125
114
def get_embed (self , entries : list [Any ], page : int , * , first : bool = False ):
126
115
self .prepare_embed (entries , page , first = first )
@@ -303,7 +292,7 @@ class TextPager(Pager):
303
292
def __init__ (
304
293
self , ctx : Context , text : str , * , prefix : str = "```" , suffix : str = "```" , max_size : int = 2000 , stop : bool = False
305
294
) -> None :
306
- paginator = commands . Paginator (prefix = prefix , suffix = suffix , max_size = max_size - 200 )
295
+ paginator = _Paginator (prefix = prefix , suffix = suffix , max_size = max_size - 200 )
307
296
for line in text .split ("\n " ):
308
297
paginator .add_line (line )
309
298
@@ -313,7 +302,7 @@ def get_page(self, page: int) -> Any:
313
302
return self .entries [page - 1 ]
314
303
315
304
def get_embed (self , entries : list [str ], page : int , * , first : bool = False ) -> discord .Embed :
316
- raise NotImplementedError
305
+ return None # type: ignore
317
306
318
307
def get_content (self , entry : str , page : int , * , first : bool = False ) -> str :
319
308
if self .maximum_pages > 1 :
0 commit comments