PycordViews 1.2.11__py3-none-any.whl → 1.2.13__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.
@@ -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.__check_custom_id(custom_id)
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
  """
@@ -166,7 +163,7 @@ class EasyModifiedViews(View):
166
163
  data = self.__callback[interaction.custom_id]['data']
167
164
 
168
165
  if func is not None:
169
- return await func(self.__callback[interaction.custom_id]['ui'], interaction, data) if data != {} else await func(self.__callback[interaction.custom_id]['ui'], interaction)
166
+ return await func(self.__callback[interaction.custom_id]['ui'], interaction, data)
170
167
 
171
168
  else:
172
169
  await interaction.response.defer(invisible=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PycordViews
3
- Version: 1.2.11
3
+ Version: 1.2.13
4
4
  Summary: Views and multibot for py-cord library
5
5
  Home-page: https://github.com/BOXERRMD/Py-cord_Views
6
6
  Author: Chronos (alias BOXERRMD)
@@ -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=k6l55q19Y5AQDn1yIQ-N1osnehzs_3ErSj_dkdSLkX4,11529
22
+ pycordViews/views/easy_modified_view.py,sha256=Li2M9mZglguoJ_o0OemehK2J2_P13Ux9uXbm-Zm-k48,11411
23
23
  pycordViews/views/errors.py,sha256=AkhGskuBjbFs0ZQdTDlVyfvAJ1WRMMQx2sAXUnYjmog,360
24
- pycordviews-1.2.11.dist-info/licenses/LICENSE,sha256=lNgcw1_xb7QENAQi3uHGymaFtbs0RV-ihiCd7AoLQjA,1082
25
- pycordviews-1.2.11.dist-info/METADATA,sha256=3ULGVq1PjOlFhT7Wv6OfafN7ML26ohLJF9cK6HD5d5o,11825
26
- pycordviews-1.2.11.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
27
- pycordviews-1.2.11.dist-info/top_level.txt,sha256=3NvgH6MjESe7Q6jb6aqHgdYrYb5NhxwxnoDyE6PkThY,125
28
- pycordviews-1.2.11.dist-info/RECORD,,
24
+ pycordviews-1.2.13.dist-info/licenses/LICENSE,sha256=lNgcw1_xb7QENAQi3uHGymaFtbs0RV-ihiCd7AoLQjA,1082
25
+ pycordviews-1.2.13.dist-info/METADATA,sha256=95g2vfHmh1WMiHbS7ggFsqHv8tQC9VVKat3SRq0Pv10,11825
26
+ pycordviews-1.2.13.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
27
+ pycordviews-1.2.13.dist-info/top_level.txt,sha256=3NvgH6MjESe7Q6jb6aqHgdYrYb5NhxwxnoDyE6PkThY,125
28
+ pycordviews-1.2.13.dist-info/RECORD,,