mirror of
https://github.com/Paillat-dev/pycord-reactive-views.git
synced 2026-01-02 09:06:21 +00:00
fixes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from collections.abc import Awaitable, Callable
|
||||
from inspect import isawaitable
|
||||
from typing import TypeGuard, TypeVar
|
||||
from typing import TypeGuard, TypeVar, Generic
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
@@ -15,7 +15,7 @@ class Unset:
|
||||
UNSET = Unset()
|
||||
|
||||
|
||||
class ReactiveValue[T]:
|
||||
class ReactiveValue(Generic[T]):
|
||||
"""A value that can be a constant, a callable, or an async callable."""
|
||||
|
||||
def __init__(self, func: Callable[[], T] | Callable[[], Awaitable[T]], default: T | Unset = UNSET):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Self, override
|
||||
from typing import Self
|
||||
|
||||
import discord
|
||||
|
||||
@@ -17,7 +17,6 @@ class ReactiveView(discord.ui.View):
|
||||
super().__init__(timeout=timeout, disable_on_timeout=disable_on_timeout)
|
||||
self._reactives: list[ReactiveButton] = []
|
||||
|
||||
@override
|
||||
def add_item(self, item: discord.ui.Item[Self]) -> None:
|
||||
if isinstance(item, ReactiveButton):
|
||||
self._reactives.append(item)
|
||||
|
||||
Reference in New Issue
Block a user