Skip to content

Commit 1975f6d

Browse files
authored
adjust
1 parent 5c7a02b commit 1975f6d

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

discord/abc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1611,7 +1611,7 @@ async def send(
16111611
if view:
16121612
if not hasattr(view, "__discord_ui_view__"):
16131613
raise InvalidArgument(
1614-
f"view parameter must be View not {view.__class__!r}"
1614+
f"view parameter must be BaseView not {view.__class__!r}"
16151615
)
16161616

16171617
components = view.to_components()

discord/channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ async def create_thread(
13281328
if view:
13291329
if not hasattr(view, "__discord_ui_view__"):
13301330
raise InvalidArgument(
1331-
f"view parameter must be View not {view.__class__!r}"
1331+
f"view parameter must be BaseView not {view.__class__!r}"
13321332
)
13331333

13341334
components = view.to_components()

discord/ui/view.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ def fits_legacy(self, item) -> bool:
203203
class BaseView(ItemInterface):
204204
"""The base class for UI views used in messages."""
205205

206+
__discord_ui_view__: ClassVar[bool] = True
206207
MAX_ITEMS: int
207208

208209
def __init__(
@@ -546,8 +547,6 @@ class View(BaseView):
546547
The parent interaction which this view was sent from.
547548
If ``None`` then the view was not sent using :meth:`InteractionResponse.send_message`.
548549
"""
549-
550-
__discord_ui_view__: ClassVar[bool] = True
551550
__view_children_items__: ClassVar[list[ItemCallbackType]] = []
552551
MAX_ITEMS: int = 25
553552

0 commit comments

Comments
 (0)