-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add detailed docstrings for row and width properties in the Item class #10057
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -100,6 +100,16 @@ def __repr__(self) -> str: | |||||||||
|
||||||||||
@property | ||||||||||
def row(self) -> Optional[int]: | ||||||||||
"""Optional[:class:`int`]: The action row this item belongs to. | ||||||||||
|
||||||||||
An action row can have up to 5 components. Valid values for the row are | ||||||||||
integers in the range 0–4 or ``None`` to indicate no specific row. | ||||||||||
Comment on lines
+105
to
+106
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This is already documented on the |
||||||||||
|
||||||||||
Raises | ||||||||||
------ | ||||||||||
ValueError | ||||||||||
If set to a value less than 0 or greater than or equal to 5. | ||||||||||
""" | ||||||||||
return self._row | ||||||||||
|
||||||||||
@row.setter | ||||||||||
|
@@ -113,6 +123,16 @@ def row(self, value: Optional[int]) -> None: | |||||||||
|
||||||||||
@property | ||||||||||
def width(self) -> int: | ||||||||||
"""int: The width of this item in a Discord UI layout. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
The width determines how much space this item occupies in an action row. | ||||||||||
This value is primarily used internally by Discord.py to calculate layout constraints. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think mentioning this is necessary? |
||||||||||
|
||||||||||
Returns | ||||||||||
------- | ||||||||||
:class:`int` | ||||||||||
The width of the item, defaulting to 1. | ||||||||||
Comment on lines
+131
to
+134
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Properties don't have this Return, as their return type are stated above. |
||||||||||
""" | ||||||||||
return 1 | ||||||||||
|
||||||||||
@property | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.