mirror of
https://github.com/TeamPGM/PagerMaid-Pyro.git
synced 2024-11-21 18:58:21 +00:00
🐛 Fix inject type hint forward references
This commit is contained in:
parent
f75fb07f44
commit
988d51feaf
@ -10,7 +10,8 @@ def inject(message: enums.Message, function, **data) -> Optional[Dict]:
|
|||||||
except Exception:
|
except Exception:
|
||||||
return None
|
return None
|
||||||
for parameter_name, parameter in signature.parameters.items():
|
for parameter_name, parameter in signature.parameters.items():
|
||||||
class_name = parameter.annotation.__name__
|
an = parameter.annotation
|
||||||
|
class_name = an.__name__ if hasattr(an, "__name__") else an
|
||||||
param = message if class_name == "Message" else services.get(class_name)
|
param = message if class_name == "Message" else services.get(class_name)
|
||||||
if not param:
|
if not param:
|
||||||
if parameter_name == "message":
|
if parameter_name == "message":
|
||||||
|
Loading…
Reference in New Issue
Block a user