PycordViews 1.2.10__py3-none-any.whl → 1.2.12__py3-none-any.whl
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/views/easy_modified_view.py +7 -9
- {pycordviews-1.2.10.dist-info → pycordviews-1.2.12.dist-info}/METADATA +1 -1
- {pycordviews-1.2.10.dist-info → pycordviews-1.2.12.dist-info}/RECORD +6 -6
- {pycordviews-1.2.10.dist-info → pycordviews-1.2.12.dist-info}/WHEEL +0 -0
- {pycordviews-1.2.10.dist-info → pycordviews-1.2.12.dist-info}/licenses/LICENSE +0 -0
- {pycordviews-1.2.10.dist-info → pycordviews-1.2.12.dist-info}/top_level.txt +0 -0
@@ -69,7 +69,7 @@ class EasyModifiedViews(View):
|
|
69
69
|
if type(ui).__name__ in ('SelectMenu', 'Pagination', 'Confirm', 'Poll', 'EasyModifiedViews'):
|
70
70
|
for item in ui.get_view.items:
|
71
71
|
self.add_items(item)
|
72
|
-
self.set_callable(item.custom_id, _callable=ui.get_callable(item.custom_id))
|
72
|
+
self.set_callable(item.custom_id, _callable=ui.get_callable(item.custom_id), data={})
|
73
73
|
|
74
74
|
else:
|
75
75
|
self.__callback[ui.custom_id] = {'ui': ui, 'func': None, 'data': {}}
|
@@ -96,7 +96,7 @@ class EasyModifiedViews(View):
|
|
96
96
|
await self._update()
|
97
97
|
return self
|
98
98
|
|
99
|
-
def set_callable_decorator(self, custom_id: str, data: dict[str, Any] =
|
99
|
+
def set_callable_decorator(self, custom_id: str, data: Optional[dict[str, Any]] = None):
|
100
100
|
"""
|
101
101
|
Decorator to set up a callable for the item
|
102
102
|
|
@@ -117,15 +117,12 @@ class EasyModifiedViews(View):
|
|
117
117
|
"""
|
118
118
|
|
119
119
|
def decorator(_callable: Callable):
|
120
|
-
self.
|
121
|
-
|
122
|
-
self.__callback[custom_id]['func'] = _callable
|
123
|
-
self.__callback[custom_id]['data'] = data
|
120
|
+
self.set_callable(custom_id, _callable=_callable, data=data)
|
124
121
|
return _callable
|
125
122
|
|
126
123
|
return decorator
|
127
124
|
|
128
|
-
def set_callable(self, *custom_ids: str, _callable: Callable, data: dict[str, Any] =
|
125
|
+
def set_callable(self, *custom_ids: str, _callable: Callable, data: Optional[dict[str, Any]] = None):
|
129
126
|
"""
|
130
127
|
set up a callable for items
|
131
128
|
:param custom_ids: items IDs of the view
|
@@ -148,7 +145,7 @@ class EasyModifiedViews(View):
|
|
148
145
|
self.__check_custom_id(custom_id)
|
149
146
|
|
150
147
|
self.__callback[custom_id]['func'] = _callable
|
151
|
-
self.__callback[custom_id]['data'] = data
|
148
|
+
self.__callback[custom_id]['data'] = data if data is not None else {}
|
152
149
|
|
153
150
|
def get_callable(self, custom_id: str) -> Union[Callable, None]:
|
154
151
|
"""
|
@@ -163,9 +160,10 @@ class EasyModifiedViews(View):
|
|
163
160
|
Func to apply items
|
164
161
|
"""
|
165
162
|
func = self.__callback[interaction.custom_id]['func']
|
163
|
+
data = self.__callback[interaction.custom_id]['data']
|
166
164
|
|
167
165
|
if func is not None:
|
168
|
-
return await func(self.__callback[interaction.custom_id]['ui'], interaction)
|
166
|
+
return await func(self.__callback[interaction.custom_id]['ui'], interaction, data) if data != {} else await func(self.__callback[interaction.custom_id]['ui'], interaction)
|
169
167
|
|
170
168
|
else:
|
171
169
|
await interaction.response.defer(invisible=True)
|
@@ -19,10 +19,10 @@ pycordViews/pagination/errors.py,sha256=CYb5gBcXx0kYDUDkNpfUrqSxQAcJE_qfpomWtUFO
|
|
19
19
|
pycordViews/pagination/page.py,sha256=sKi_gCFt1euY7uJKWgMnxEqP1B4LMhUysxQ8oQbhNVQ,1147
|
20
20
|
pycordViews/pagination/pagination_view.py,sha256=T9kN_-hj2bD4ia4NI2CIkzJCgdp_6xxCQZPsK_Pyu4Q,5604
|
21
21
|
pycordViews/views/__init__.py,sha256=yligptZmw-np8tjKLr76SVmi0807Nk6jCyKkKYLhbCY,89
|
22
|
-
pycordViews/views/easy_modified_view.py,sha256=
|
22
|
+
pycordViews/views/easy_modified_view.py,sha256=Tq2S0lcgIx6LGgm9py115B_PZBc1IFINd1jdheoxKrw,11500
|
23
23
|
pycordViews/views/errors.py,sha256=AkhGskuBjbFs0ZQdTDlVyfvAJ1WRMMQx2sAXUnYjmog,360
|
24
|
-
pycordviews-1.2.
|
25
|
-
pycordviews-1.2.
|
26
|
-
pycordviews-1.2.
|
27
|
-
pycordviews-1.2.
|
28
|
-
pycordviews-1.2.
|
24
|
+
pycordviews-1.2.12.dist-info/licenses/LICENSE,sha256=lNgcw1_xb7QENAQi3uHGymaFtbs0RV-ihiCd7AoLQjA,1082
|
25
|
+
pycordviews-1.2.12.dist-info/METADATA,sha256=W3q8xkWwFb4lWDUvMgkX1VcA66z0tcGT3OX2q73N0OQ,11825
|
26
|
+
pycordviews-1.2.12.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
27
|
+
pycordviews-1.2.12.dist-info/top_level.txt,sha256=3NvgH6MjESe7Q6jb6aqHgdYrYb5NhxwxnoDyE6PkThY,125
|
28
|
+
pycordviews-1.2.12.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|