mirror of
https://github.com/Paillat-dev/pycord-reactive-views.git
synced 2026-01-02 01:06:18 +00:00
🐛 Fix color_select.py example not changing embed color
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from collections.abc import Awaitable, Callable
|
||||
from inspect import isawaitable
|
||||
from typing import TypeGuard, TypeVar, Generic
|
||||
from typing import Generic, TypeGuard, TypeVar
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
from typing import Self
|
||||
|
||||
import discord
|
||||
from typing_extensions import override
|
||||
|
||||
from .components import ReactiveButton
|
||||
from .components import Reactive
|
||||
|
||||
|
||||
class ReactiveView(discord.ui.View):
|
||||
@@ -15,10 +16,11 @@ class ReactiveView(discord.ui.View):
|
||||
disable_on_timeout: bool = False,
|
||||
):
|
||||
super().__init__(timeout=timeout, disable_on_timeout=disable_on_timeout)
|
||||
self._reactives: list[ReactiveButton] = []
|
||||
self._reactives: list[Reactive] = []
|
||||
|
||||
@override
|
||||
def add_item(self, item: discord.ui.Item[Self]) -> None:
|
||||
if isinstance(item, ReactiveButton):
|
||||
if isinstance(item, Reactive):
|
||||
self._reactives.append(item)
|
||||
super().add_item(item)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user