Skip to content

Commit c929c67

Browse files
style(pre-commit): auto fixes from pre-commit.com hooks
1 parent 2b981d3 commit c929c67

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

discord/ui/item.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,10 @@ def view(self) -> V | None:
196196
The parent view of this item, or ``None`` if the item is not attached to any view.
197197
"""
198198
return self._view
199-
199+
200200
@view.setter
201201
def view(self, value) -> None:
202202
self._view = value
203-
204203

205204
async def callback(self, interaction: Interaction):
206205
"""|coro|

discord/ui/label.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
from __future__ import annotations
22

3-
from functools import partial
4-
from typing import TYPE_CHECKING, ClassVar, Iterator, TypeVar
3+
from typing import TYPE_CHECKING, Iterator, TypeVar
54

65
from ..components import Label as LabelComponent
76
from ..components import SelectOption, _component_factory
87
from ..enums import ButtonStyle, ChannelType, ComponentType, InputTextStyle
98
from ..utils import find, get
109
from .button import Button
10+
from .input_text import InputText
1111
from .item import Item, ItemCallbackType
1212
from .select import Select
13-
from .input_text import InputText
1413

1514
__all__ = ("Label",)
1615

@@ -280,7 +279,7 @@ def from_component(cls: type[L], component: LabelComponent) -> L:
280279
item,
281280
id=component.id,
282281
label=component.label,
283-
description=component.description
282+
description=component.description,
284283
)
285284

286285
callback = None

discord/ui/modal.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import time
77
from functools import partial
88
from itertools import groupby
9-
from typing import TYPE_CHECKING, Any, Callable, TypeVar, Union
9+
from typing import TYPE_CHECKING, Any, TypeVar, Union
1010

1111
from ..enums import ComponentType
1212
from ..utils import find
@@ -171,13 +171,13 @@ def add_item(self, item: ModalItem) -> Self:
171171
Parameters
172172
----------
173173
item: Union[class:`InputText`, :class:`Item`]
174-
The item to add to the modal
174+
The item to add to the modal
175175
"""
176176

177177
if len(self._children) > 5:
178178
raise ValueError("You can only have up to 5 items in a modal.")
179179

180-
if not isinstance(item, (Item, )):
180+
if not isinstance(item, (Item,)):
181181
raise TypeError(f"expected Item, not {item.__class__!r}")
182182

183183
self._children.append(item)
@@ -239,6 +239,7 @@ async def on_timeout(self) -> None:
239239
A callback that is called when a modal's timeout elapses without being explicitly stopped.
240240
"""
241241

242+
242243
class Modal(BaseModal):
243244
"""Represents a UI modal for InputText components.
244245
@@ -338,6 +339,7 @@ def remove_item(self, item: ModalItem) -> Self:
338339
pass
339340
return self
340341

342+
341343
class DesignerModal(BaseModal):
342344
"""Represents a UI modal compatible with all modal features.
343345
@@ -388,8 +390,10 @@ def add_item(self, item: ModalItem) -> Self:
388390
The item to add to the modal
389391
"""
390392

391-
if isinstance(item, (InputText, )):
392-
raise TypeError(f"DesignerModal does not accept InputText directly. Use Label instead.")
393+
if isinstance(item, (InputText,)):
394+
raise TypeError(
395+
f"DesignerModal does not accept InputText directly. Use Label instead."
396+
)
393397

394398
super().add_item(item)
395399
return self

0 commit comments

Comments
 (0)