31
31
JUMP_LAST_LABEL = " \u276f \u276f " # >>
32
32
STOP_PAGINATE_EMOJI = "\u274c " # [:x:] This is an emoji, which is treated differently from the above
33
33
34
- logger : ModmailLogger = logging . getLogger ( __name__ )
34
+ NO_EMBED_FOOTER_BUMP = 15
35
35
36
36
_AUTOGENERATE = object ()
37
37
38
38
39
+ logger : ModmailLogger = logging .getLogger (__name__ )
40
+
41
+
39
42
class ButtonPaginator (ui .View , DpyPaginator ):
40
43
"""
41
44
A class that helps in paginating long messages/embeds, which can be interacted via discord buttons.
@@ -78,6 +81,8 @@ def __init__(
78
81
If source message is provided and only_users is NOT provided, the paginator will respond
79
82
to the author of the source message. To override this, pass an empty list to `only_users`.
80
83
84
+ By default, an embed is created. However, a custom embed can
85
+ be passed, or None can be passed to not use an embed.
81
86
"""
82
87
self .index = 0
83
88
self ._pages : List [str ] = []
@@ -92,11 +97,11 @@ def __init__(
92
97
93
98
# used if embed is None
94
99
self .content = ""
95
- if embed is None :
100
+ if self . embed is None :
96
101
self .title = title
97
102
# need to set the max_size down a few to be able to set a "footer"
98
103
# page indicator is "page xx of xx"
99
- self .max_size -= 15
104
+ self .max_size -= NO_EMBED_FOOTER_BUMP + len ( self . title or "" )
100
105
if self .title is not None :
101
106
self .max_size -= len (title )
102
107
if footer_text is not None :
0 commit comments