Improve component typing

This commit is contained in:
Lilly Rose Berner
2022-05-16 21:30:03 +02:00
committed by GitHub
parent b7e25645dc
commit 7267d18d9e
10 changed files with 131 additions and 69 deletions

View File

@ -114,7 +114,6 @@ class TextInput(Item[V]):
raise TypeError(f'expected custom_id to be str not {custom_id.__class__!r}')
self._underlying = TextInputComponent._raw_construct(
type=ComponentType.text_input,
label=label,
style=style,
custom_id=custom_id,
@ -238,7 +237,7 @@ class TextInput(Item[V]):
@property
def type(self) -> Literal[ComponentType.text_input]:
return ComponentType.text_input
return self._underlying.type
def is_dispatchable(self) -> bool:
return False