mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-09 17:33:44 +00:00
Oops. Mask position is Deserializable.
This commit is contained in:
parent
77d5bac5e4
commit
a6e90655bc
1 changed files with 13 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
from .base import Serializable
|
||||
from .base import Deserializable
|
||||
|
||||
|
||||
class MaskPosition(Serializable):
|
||||
class MaskPosition(Deserializable):
|
||||
"""
|
||||
This object describes the position on faces where a mask should be placed by default.
|
||||
|
||||
|
|
@ -13,3 +13,14 @@ class MaskPosition(Serializable):
|
|||
self.x_shift: float = x_shift
|
||||
self.y_shift: float = y_shift
|
||||
self.zoom: float = zoom
|
||||
|
||||
@classmethod
|
||||
def de_json(cls, raw_data):
|
||||
raw_data = cls.check_json(raw_data)
|
||||
|
||||
point = raw_data.get('point')
|
||||
x_shift = raw_data.get('x_shift')
|
||||
y_shift = raw_data.get('y_shift')
|
||||
zoom = raw_data.get('zoom')
|
||||
|
||||
return cls(point=point, x_shift=x_shift, y_shift=y_shift, zoom=zoom)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue