PycordViews 1.1.1__tar.gz → 1.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pycordviews-1.1.1 → pycordviews-1.1.3}/PKG-INFO +1 -1
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/PycordViews.egg-info/PKG-INFO +1 -1
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pycordViews/menu/selectMenu.py +7 -6
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pycordViews/pagination/pagination_view.py +8 -6
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pycordViews/views/easy_modified_view.py +1 -1
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/setup.py +1 -1
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/LICENSE +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/PycordViews.egg-info/SOURCES.txt +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/PycordViews.egg-info/dependency_links.txt +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/PycordViews.egg-info/requires.txt +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/PycordViews.egg-info/top_level.txt +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/README.md +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pycordViews/__init__.py +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pycordViews/menu/__init__.py +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pycordViews/menu/errors.py +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pycordViews/menu/menu.py +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pycordViews/multibot/__init__.py +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pycordViews/multibot/errors.py +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pycordViews/multibot/process_for_bots.py +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pycordViews/multibot/process_messages.py +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pycordViews/multibot/runner.py +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pycordViews/multibot/start_multibot.py +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pycordViews/pagination/__init__.py +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pycordViews/pagination/errors.py +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pycordViews/typeViews.py +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pycordViews/views/__init__.py +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pycordViews/views/errors.py +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/pyproject.toml +0 -0
 - {pycordviews-1.1.1 → pycordviews-1.1.3}/setup.cfg +0 -0
 
| 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            from ..views.easy_modified_view import EasyModifiedViews
         
     | 
| 
       2 
2 
     | 
    
         
             
            from .menu import Menu
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
       4 
     | 
    
         
            -
            from typing import Union, Callable
         
     | 
| 
      
 4 
     | 
    
         
            +
            from typing import Union, Callable, Any
         
     | 
| 
       5 
5 
     | 
    
         
             
            from discord.components import ComponentType
         
     | 
| 
       6 
6 
     | 
    
         
             
            from discord import ChannelType, Member, TextChannel, ApplicationContext
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
         @@ -97,24 +97,25 @@ class SelectMenu: 
     | 
|
| 
       97 
97 
     | 
    
         | 
| 
       98 
98 
     | 
    
         
             
                    return menu
         
     | 
| 
       99 
99 
     | 
    
         | 
| 
       100 
     | 
    
         
            -
                def set_callable(self, *custom_ids: str, _callable : Callable):
         
     | 
| 
      
 100 
     | 
    
         
            +
                def set_callable(self, *custom_ids: str, _callable : Callable) -> "SelectMenu":
         
     | 
| 
       101 
101 
     | 
    
         
             
                    """
         
     | 
| 
       102 
102 
     | 
    
         
             
                    Set a callable for the menu associated with the custom_id
         
     | 
| 
       103 
103 
     | 
    
         
             
                    :param custom_ids: IDs to menus
         
     | 
| 
       104 
104 
     | 
    
         
             
                    """
         
     | 
| 
       105 
105 
     | 
    
         
             
                    self.__select_menu.set_callable(*custom_ids, _callable=_callable)
         
     | 
| 
      
 106 
     | 
    
         
            +
                    return self
         
     | 
| 
       106 
107 
     | 
    
         | 
| 
       107 
     | 
    
         
            -
                async def respond(self, ctx: ApplicationContext, *args, **kwargs) ->  
     | 
| 
      
 108 
     | 
    
         
            +
                async def respond(self, ctx: ApplicationContext, *args, **kwargs) -> Any:
         
     | 
| 
       108 
109 
     | 
    
         
             
                    """
         
     | 
| 
       109 
110 
     | 
    
         
             
                    Respond at the ApplicationContext
         
     | 
| 
       110 
111 
     | 
    
         
             
                    """
         
     | 
| 
       111 
     | 
    
         
            -
                    await self.__select_menu.respond(ctx=ctx, *args, view=self.__select_menu, **kwargs)
         
     | 
| 
      
 112 
     | 
    
         
            +
                    return await self.__select_menu.respond(ctx=ctx, *args, view=self.__select_menu, **kwargs)
         
     | 
| 
       112 
113 
     | 
    
         | 
| 
       113 
     | 
    
         
            -
                async def send(self, target: Union[Member, TextChannel], *args, **kwargs) ->  
     | 
| 
      
 114 
     | 
    
         
            +
                async def send(self, target: Union[Member, TextChannel], *args, **kwargs) -> Any:
         
     | 
| 
       114 
115 
     | 
    
         
             
                    """
         
     | 
| 
       115 
116 
     | 
    
         
             
                    Send at the target
         
     | 
| 
       116 
117 
     | 
    
         
             
                    """
         
     | 
| 
       117 
     | 
    
         
            -
                    await self.__select_menu.send(target=target, *args, view=self.__select_menu, **kwargs)
         
     | 
| 
      
 118 
     | 
    
         
            +
                    return await self.__select_menu.send(target=target, *args, view=self.__select_menu, **kwargs)
         
     | 
| 
       118 
119 
     | 
    
         | 
| 
       119 
120 
     | 
    
         
             
                @property
         
     | 
| 
       120 
121 
     | 
    
         
             
                def get_view(self) -> EasyModifiedViews:
         
     | 
| 
         @@ -30,7 +30,7 @@ class Pagination: 
     | 
|
| 
       30 
30 
     | 
    
         
             
                    self.__pages: list[tuple[tuple, dict]] = []
         
     | 
| 
       31 
31 
     | 
    
         
             
                    self.__current_page: int = 0
         
     | 
| 
       32 
32 
     | 
    
         | 
| 
       33 
     | 
    
         
            -
                def add_page(self, *args, **kwargs) ->  
     | 
| 
      
 33 
     | 
    
         
            +
                def add_page(self, *args, **kwargs) -> "Pagination":
         
     | 
| 
       34 
34 
     | 
    
         
             
                    """
         
     | 
| 
       35 
35 
     | 
    
         
             
                    Adds a page (in a list) as if this function directly sent the message
         
     | 
| 
       36 
36 
     | 
    
         
             
                    Pages are just modified and not reset ! Don't forget to disable embeds or content if the page don't need this.
         
     | 
| 
         @@ -38,8 +38,9 @@ class Pagination: 
     | 
|
| 
       38 
38 
     | 
    
         
             
                    add_page(content="my message", embeds=[embed1, embed2], ...)
         
     | 
| 
       39 
39 
     | 
    
         
             
                    """
         
     | 
| 
       40 
40 
     | 
    
         
             
                    self.__pages.append((args, kwargs))
         
     | 
| 
      
 41 
     | 
    
         
            +
                    return self
         
     | 
| 
       41 
42 
     | 
    
         | 
| 
       42 
     | 
    
         
            -
                def delete_pages(self, *page_numbers: Union[str, int]):
         
     | 
| 
      
 43 
     | 
    
         
            +
                def delete_pages(self, *page_numbers: Union[str, int]) -> "Pagination":
         
     | 
| 
       43 
44 
     | 
    
         
             
                    """
         
     | 
| 
       44 
45 
     | 
    
         
             
                    Deletes pages in the order in which they were added
         
     | 
| 
       45 
46 
     | 
    
         
             
                    **Start to 0 !**
         
     | 
| 
         @@ -53,6 +54,7 @@ class Pagination: 
     | 
|
| 
       53 
54 
     | 
    
         
             
                            raise PageNumberNotFound(page_number)
         
     | 
| 
       54 
55 
     | 
    
         | 
| 
       55 
56 
     | 
    
         
             
                        del self.__pages[page_number]
         
     | 
| 
      
 57 
     | 
    
         
            +
                    return self
         
     | 
| 
       56 
58 
     | 
    
         | 
| 
       57 
59 
     | 
    
         
             
                async def __turn_page(self, button, interaction: Interaction):
         
     | 
| 
       58 
60 
     | 
    
         
             
                    """
         
     | 
| 
         @@ -91,18 +93,18 @@ class Pagination: 
     | 
|
| 
       91 
93 
     | 
    
         
             
                    # Acknowledge the interaction
         
     | 
| 
       92 
94 
     | 
    
         
             
                    await interaction.response.defer(invisible=True)
         
     | 
| 
       93 
95 
     | 
    
         | 
| 
       94 
     | 
    
         
            -
                async def send(self, target: Union[Member, TextChannel]) ->  
     | 
| 
      
 96 
     | 
    
         
            +
                async def send(self, target: Union[Member, TextChannel]) -> Any:
         
     | 
| 
       95 
97 
     | 
    
         
             
                    """
         
     | 
| 
       96 
98 
     | 
    
         
             
                    Send pagination without introduction message.
         
     | 
| 
       97 
99 
     | 
    
         
             
                    :param target: The member or channel to send the pagination
         
     | 
| 
       98 
100 
     | 
    
         
             
                    """
         
     | 
| 
       99 
     | 
    
         
            -
                    await self.__view.send(ctx=target, *self.__pages[0][0], **self.__pages[0][1], view=self.get_view)
         
     | 
| 
      
 101 
     | 
    
         
            +
                    return await self.__view.send(ctx=target, *self.__pages[0][0], **self.__pages[0][1], view=self.get_view)
         
     | 
| 
       100 
102 
     | 
    
         | 
| 
       101 
     | 
    
         
            -
                async def respond(self, ctx: ApplicationContext) ->  
     | 
| 
      
 103 
     | 
    
         
            +
                async def respond(self, ctx: ApplicationContext) -> Any:
         
     | 
| 
       102 
104 
     | 
    
         
             
                    """
         
     | 
| 
       103 
105 
     | 
    
         
             
                    Respond to the command call
         
     | 
| 
       104 
106 
     | 
    
         
             
                    """
         
     | 
| 
       105 
     | 
    
         
            -
                    await self.__view.respond(ctx=ctx, *self.__pages[0][0], **self.__pages[0][1], view=self.get_view)
         
     | 
| 
      
 107 
     | 
    
         
            +
                    return await self.__view.respond(ctx=ctx, *self.__pages[0][0], **self.__pages[0][1], view=self.get_view)
         
     | 
| 
       106 
108 
     | 
    
         | 
| 
       107 
109 
     | 
    
         
             
                @property
         
     | 
| 
       108 
110 
     | 
    
         
             
                def get_view(self) -> EasyModifiedViews:
         
     | 
| 
         @@ -135,7 +135,7 @@ class EasyModifiedViews(View): 
     | 
|
| 
       135 
135 
     | 
    
         
             
                    func = self.__callback[interaction.custom_id]['func']
         
     | 
| 
       136 
136 
     | 
    
         | 
| 
       137 
137 
     | 
    
         
             
                    if func is not None:
         
     | 
| 
       138 
     | 
    
         
            -
                        await func(self.__callback[interaction.custom_id]['ui'], interaction)
         
     | 
| 
      
 138 
     | 
    
         
            +
                        return await func(self.__callback[interaction.custom_id]['ui'], interaction)
         
     | 
| 
       139 
139 
     | 
    
         | 
| 
       140 
140 
     | 
    
         
             
                    else:
         
     | 
| 
       141 
141 
     | 
    
         
             
                        await interaction.response.defer(invisible=True)
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     |