mirror of
https://github.com/TeamPGM/PagerMaid-Pyro.git
synced 2024-11-21 18:18:17 +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:
|
||||
return None
|
||||
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)
|
||||
if not param:
|
||||
if parameter_name == "message":
|
||||
|
Loading…
Reference in New Issue
Block a user