You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This can be set by the user when constructing an Item. If not, Discord will automatically provide one when the item's parent is sent.
119
+
120
+
Returns
121
+
-------
122
+
Optional[:class:`int`]
123
+
The ID of this item, or ``None`` if the user didn't set one.
124
+
"""
125
+
returnself._underlyingandself._underlying.id
126
+
127
+
@id.setter
128
+
defid(self, value) ->None:
129
+
ifnotself._underlying:
130
+
return
131
+
self._underlying.id=value
132
+
133
+
classViewItem(Item[V]):
134
+
"""Represents an item used in Views.
135
+
136
+
The following are the original items supported in :class:`discord.ui.View`:
137
+
138
+
- :class:`discord.ui.Button`
139
+
- :class:`discord.ui.Select`
140
+
141
+
And the following are new items under the "Components V2" specification for use in :class:`discord.ui.DesignerView`:
142
+
143
+
- :class:`discord.ui.Section`
144
+
- :class:`discord.ui.TextDisplay`
145
+
- :class:`discord.ui.Thumbnail`
146
+
- :class:`discord.ui.MediaGallery`
147
+
- :class:`discord.ui.File`
148
+
- :class:`discord.ui.Separator`
149
+
- :class:`discord.ui.Container`
150
+
151
+
Additionally, :class:`discord.ui.ActionRow` should be used in :class:`discord.ui.DesignerView` to support :class:`discord.ui.Button` and :class:`discord.ui.Select`.
152
+
153
+
.. versionadded:: 2.7
154
+
"""
155
+
156
+
def__init__(self):
157
+
super().__init__()
158
+
self._view: V|None=None
159
+
self._row: int|None=None
160
+
self._rendered_row: int|None=None
161
+
self.parent: Item|BaseView|None=self.view
162
+
125
163
@property
126
164
defrow(self) ->int|None:
127
165
"""Gets or sets the row position of this item within its parent view.
@@ -164,30 +202,11 @@ def width(self) -> int:
164
202
"""
165
203
return1
166
204
167
-
@property
168
-
defid(self) ->int|None:
169
-
"""Gets this item's ID.
170
-
171
-
This can be set by the user when constructing an Item. If not, Discord will automatically provide one when the View is sent.
172
-
173
-
Returns
174
-
-------
175
-
Optional[:class:`int`]
176
-
The ID of this item, or ``None`` if the user didn't set one.
177
-
"""
178
-
returnself._underlyingandself._underlying.id
179
-
180
-
@id.setter
181
-
defid(self, value) ->None:
182
-
ifnotself._underlying:
183
-
return
184
-
self._underlying.id=value
185
-
186
205
@property
187
206
defview(self) ->V|None:
188
207
"""Gets the parent view associated with this item.
189
208
190
-
The view refers to the container that holds this item. This is typically set
209
+
The view refers to the structure that holds this item. This is typically set
0 commit comments