PycordViews 1.2.21__tar.gz → 1.2.23__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.2.21 → pycordviews-1.2.23}/PKG-INFO +1 -1
- {pycordviews-1.2.21 → pycordviews-1.2.23}/PycordViews.egg-info/PKG-INFO +1 -1
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/menu/selectMenu.py +2 -2
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/pagination/pagination_view.py +7 -7
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/views/easy_modified_view.py +2 -2
- {pycordviews-1.2.21 → pycordviews-1.2.23}/setup.py +1 -1
- {pycordviews-1.2.21 → pycordviews-1.2.23}/LICENSE +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/PycordViews.egg-info/SOURCES.txt +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/PycordViews.egg-info/dependency_links.txt +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/PycordViews.egg-info/requires.txt +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/PycordViews.egg-info/top_level.txt +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/README.md +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/__init__.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/kit/__init__.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/kit/confirm.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/kit/poll.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/menu/__init__.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/menu/errors.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/menu/menu.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/modal/__init__.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/modal/easy_modal_view.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/modal/errors.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/multibot/__init__.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/multibot/bot.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/multibot/errors.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/multibot/multibot.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/multibot/process.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/pagination/__init__.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/pagination/errors.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/pagination/page.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/views/__init__.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pycordViews/views/errors.py +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/pyproject.toml +0 -0
- {pycordviews-1.2.21 → pycordviews-1.2.23}/setup.cfg +0 -0
@@ -4,7 +4,7 @@ from .menu import Menu
|
|
4
4
|
|
5
5
|
from typing import Union, Callable, Any
|
6
6
|
from discord.components import ComponentType
|
7
|
-
from discord import ChannelType, Member, ApplicationContext
|
7
|
+
from discord import ChannelType, Member, ApplicationContext, Interaction
|
8
8
|
from discord.abc import GuildChannel
|
9
9
|
|
10
10
|
class SelectMenu:
|
@@ -108,7 +108,7 @@ class SelectMenu:
|
|
108
108
|
self.__select_menu.set_callable(*custom_ids, _callable=_callable)
|
109
109
|
return self
|
110
110
|
|
111
|
-
async def respond(self, ctx: ApplicationContext, *args, **kwargs) -> Any:
|
111
|
+
async def respond(self, ctx: Union[ApplicationContext, Interaction], *args, **kwargs) -> Any:
|
112
112
|
"""
|
113
113
|
Respond at the ApplicationContext
|
114
114
|
"""
|
@@ -14,7 +14,7 @@ class Pagination:
|
|
14
14
|
Allows you to easily setup a view pagination
|
15
15
|
"""
|
16
16
|
|
17
|
-
def __init__(self, timeout: Union[float, None] = None, disabled_on_timeout: bool = False):
|
17
|
+
def __init__(self, timeout: Union[float, None] = None, disabled_on_timeout: bool = False, default_row: int = 0):
|
18
18
|
"""
|
19
19
|
Initialisation for pagination
|
20
20
|
:param timeout: The time before disable items on the view
|
@@ -22,11 +22,11 @@ class Pagination:
|
|
22
22
|
"""
|
23
23
|
self.__view = EasyModifiedViews(timeout, disabled_on_timeout=disabled_on_timeout)
|
24
24
|
|
25
|
-
self.__view.add_items(Button(label='⏮', row=
|
26
|
-
self.__view.add_items(Button(label='◀', row=
|
27
|
-
self.__view.add_items(Button(label='None', row=
|
28
|
-
self.__view.add_items(Button(label='▶', row=
|
29
|
-
self.__view.add_items(Button(label='⏭', row=
|
25
|
+
self.__view.add_items(Button(label='⏮', row=default_row, custom_id='back+', style=ButtonStyle.blurple))
|
26
|
+
self.__view.add_items(Button(label='◀', row=default_row, custom_id='back', style=ButtonStyle.blurple))
|
27
|
+
self.__view.add_items(Button(label='None', row=default_row, custom_id='counter', style=ButtonStyle.gray, disabled=True))
|
28
|
+
self.__view.add_items(Button(label='▶', row=default_row, custom_id='forward', style=ButtonStyle.blurple))
|
29
|
+
self.__view.add_items(Button(label='⏭', row=default_row, custom_id='forward+', style=ButtonStyle.blurple))
|
30
30
|
self.__view.set_callable('back+', 'back', 'forward', 'forward+', _callable=self.__turn_page)
|
31
31
|
|
32
32
|
self.__pages: list[Page] = []
|
@@ -110,7 +110,7 @@ class Pagination:
|
|
110
110
|
first_page = self.__pages[0]
|
111
111
|
return await self.__view.send(target=target, content=first_page.content, embeds=first_page.embeds, files=first_page.files, view=self.__view.copy() + first_page.get_page_view)
|
112
112
|
|
113
|
-
async def respond(self, ctx: ApplicationContext) -> Any:
|
113
|
+
async def respond(self, ctx: Union[ApplicationContext, Interaction]) -> Any:
|
114
114
|
"""
|
115
115
|
Respond to the command call
|
116
116
|
:param ctx: ApplicationContext to respond
|
@@ -43,9 +43,9 @@ class EasyModifiedViews(View):
|
|
43
43
|
if custom_id not in self.__callback.keys():
|
44
44
|
raise CustomIDNotFound()
|
45
45
|
|
46
|
-
async def respond(self, ctx: ApplicationContext, *args, **kwargs) -> None:
|
46
|
+
async def respond(self, ctx: Union[ApplicationContext, Interaction], *args, **kwargs) -> None:
|
47
47
|
"""
|
48
|
-
Respond at the ApplicationContext
|
48
|
+
Respond at the ApplicationContext or Interaction
|
49
49
|
"""
|
50
50
|
self.__ctx = await ctx.respond(*args, **kwargs)
|
51
51
|
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|