We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 123223c commit 97ea3fdCopy full SHA for 97ea3fd
discord_slash/model.py
@@ -484,10 +484,10 @@ def from_type(cls, t: type):
484
return cls.ROLE
485
if hasattr(typing, "_GenericAlias"): # 3.7 onwards
486
# Easier than imports
487
- if (
488
- t.__origin__ is not None and t.__origin__ is typing.Union
489
- ): # proven in 3.7.8+, 3.8.6+, 3.9+ definitively
490
- return cls.MENTIONABLE
+ if hasattr(t, "__origin__"):
+ if t.__origin__ is typing.Union:
+ # proven in 3.7.8+, 3.8.6+, 3.9+ definitively
+ return cls.MENTIONABLE
491
if not hasattr(typing, "_GenericAlias"): # py 3.6
492
if isinstance(t, typing._Union): # noqa
493
return cls.MENTIONABLE
0 commit comments