2121FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2222DEALINGS IN THE SOFTWARE.
2323"""
24- import copy
2524from typing import Dict , List , Optional , Union
2625
2726import discord
@@ -274,7 +273,6 @@ def __init__(
274273 self .default_button_row = default_button_row
275274 self .loop_pages = loop_pages
276275 self .custom_view = custom_view
277- self .custom_view_items = []
278276 self .message : Union [discord .Message , discord .WebhookMessage , None ] = None
279277
280278 if self .custom_buttons and not self .use_default_buttons :
@@ -395,6 +393,7 @@ async def disable(
395393 page: Optional[Union[:class:`str`, Union[List[:class:`discord.Embed`], :class:`discord.Embed`]]]
396394 The page content to show after disabling the paginator.
397395 """
396+ page = self .get_page_content (page )
398397 for item in self .children :
399398 if item not in self .custom_view_items or include_custom :
400399 item .disabled = True
@@ -421,9 +420,10 @@ async def cancel(
421420 page: Optional[Union[:class:`str`, Union[List[:class:`discord.Embed`], :class:`discord.Embed`]]]
422421 The page content to show after canceling the paginator.
423422 """
424- items = copy .copy (self .children )
423+ items = self .children .copy ()
424+ page = self .get_page_content (page )
425425 for item in items :
426- if item not in self .custom_view_items or include_custom :
426+ if item not in self .custom_view . children or include_custom :
427427 self .remove_item (item )
428428 if page :
429429 await self .message .edit (
@@ -613,9 +613,7 @@ def update_buttons(self) -> Dict:
613613 # The bot developer should handle row assignments for their view before passing it to Paginator
614614 if self .custom_view :
615615 for item in self .custom_view .children :
616- self .custom_view_items .append (item )
617616 self .add_item (item )
618-
619617 return self .buttons
620618
621619 @staticmethod
0 commit comments