handle TypeError in Message.object_id

This commit is contained in:
Izalia Mae 2024-01-16 00:33:05 -05:00
parent b9eb67b32d
commit 2ebb295be1

View file

@ -251,6 +251,16 @@ class Message(ApMessage):
})
# todo: remove when fixed in aputils
@property
def object_id(self) -> str:
try:
return self["object"]["id"]
except (KeyError, TypeError):
return self["object"]
class Response(AiohttpResponse):
@classmethod
def new(cls: Type[Response],