aiogram/aiogram/types/animation.py

33 lines
1 KiB
Python
Raw Normal View History

2017-10-12 16:43:23 +03:00
from . import base
from . import fields
2018-01-24 02:29:48 +02:00
from . import mixins
2017-10-12 16:43:23 +03:00
from .photo_size import PhotoSize
from ..utils.deprecated import warn_deprecated
2017-10-12 16:43:23 +03:00
2018-01-24 02:29:48 +02:00
class Animation(base.TelegramObject, mixins.Downloadable):
2017-10-12 16:43:23 +03:00
"""
You can provide an animation for your game so that it looks stylish in chats
(check out Lumberjack for an example).
This object represents an animation file to be displayed in the message containing a game.
https://core.telegram.org/bots/api#animation
"""
file_id: base.String = fields.Field()
2019-12-31 22:46:08 +05:00
file_unique_id: base.String = fields.Field()
width: base.Integer = fields.Field()
height: base.Integer = fields.Field()
duration: base.Integer = fields.Field()
thumbnail: PhotoSize = fields.Field(base=PhotoSize)
2017-10-12 16:43:23 +03:00
file_name: base.String = fields.Field()
mime_type: base.String = fields.Field()
file_size: base.Integer = fields.Field()
@property
def thumb(self):
warn_deprecated(
"thumb is deprecated. Use thumbnail instead",
)
return self.thumbnail