Add Channel types support #100

Merged
Chiggy-Playz merged 4 commits from ChannelTypes into 2.0 2021-10-13 16:34:13 +00:00
Showing only changes of commit 8699436fd2 - Show all commits

View File

@ -1242,9 +1242,10 @@ class Command(_BaseCommand, Generic[CogT, P, T]):
annotation = str
origin = None
if not required and origin is not None and len(annotation.__args__) == 2:
if not required and origin is Union and annotation.__args__[-1] is type(None):
# Unpack Optional[T] (Union[T, None]) into just T
annotation, origin = annotation.__args__[0], None
annotation = annotation.__args__[0]
origin = getattr(annotation, '__origin__', None)
Gnome-py commented 2021-10-13 15:49:35 +00:00 (Migrated from github.com)
Review

Please undo this change, it seems to be #98

Please undo this change, it seems to be #98
Chiggy-Playz commented 2021-10-13 16:32:15 +00:00 (Migrated from github.com)
Review

Fixed in e84cef2

Fixed in e84cef2
option: Dict[str, Any] = {
"type": 3,