Skip to content

Commit e27ff1d

Browse files
authored
fix: 🏷️ Fix incorrect view rtypes (#2940)
🏷️ Fix incorrect view rtypes
1 parent 916dbb6 commit e27ff1d

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

discord/ui/media_gallery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def add_item(
8080
*,
8181
description: str = None,
8282
spoiler: bool = False,
83-
) -> None:
83+
) -> Self:
8484
"""Adds a new media item to the gallery.
8585
8686
Parameters

discord/ui/view.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,16 @@
3131
import time
3232
from functools import partial
3333
from itertools import groupby
34-
from typing import TYPE_CHECKING, Any, Callable, ClassVar, Iterator, Sequence, TypeVar
34+
from typing import (
35+
TYPE_CHECKING,
36+
Any,
37+
Callable,
38+
ClassVar,
39+
Iterator,
40+
Self,
41+
Sequence,
42+
TypeVar,
43+
)
3544

3645
from ..components import ActionRow as ActionRowComponent
3746
from ..components import Button as ButtonComponent
@@ -375,7 +384,7 @@ def _expires_at(self) -> float | None:
375384
return time.monotonic() + self.timeout
376385
return None
377386

378-
def add_item(self, item: Item[V]) -> None:
387+
def add_item(self, item: Item[V]) -> Self:
379388
"""Adds an item to the view.
380389
381390
Parameters

0 commit comments

Comments
 (0)