Merge pull request #62 from Olegt0rr/minor

minor code styling
This commit is contained in:
Alex Root Junior 2018-08-07 19:51:06 +03:00 committed by GitHub
commit 8e57da0e20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -437,20 +437,21 @@ class Bot(BaseBot):
return types.Message(**result) return types.Message(**result)
async def send_animation(self, async def send_animation(self,
chat_id: typing.Union[base.Integer, base.String], chat_id: typing.Union[base.Integer, base.String],
animation: typing.Union[base.InputFile, base.String], animation: typing.Union[base.InputFile, base.String],
duration: typing.Union[base.Integer, None] = None, duration: typing.Union[base.Integer, None] = None,
width: typing.Union[base.Integer, None] = None, width: typing.Union[base.Integer, None] = None,
height: typing.Union[base.Integer, None] = None, height: typing.Union[base.Integer, None] = None,
thumb: typing.Union[typing.Union[base.InputFile, base.String], None] = None, thumb: typing.Union[typing.Union[base.InputFile, base.String], None] = None,
caption: typing.Union[base.String, None] = None, caption: typing.Union[base.String, None] = None,
parse_mode: typing.Union[base.String, None] = None, parse_mode: typing.Union[base.String, None] = None,
disable_notification: typing.Union[base.Boolean, None] = None, disable_notification: typing.Union[base.Boolean, None] = None,
reply_to_message_id: typing.Union[base.Integer, None] = None, reply_to_message_id: typing.Union[base.Integer, None] = None,
reply_markup: typing.Union[typing.Union[types.InlineKeyboardMarkup, reply_markup: typing.Union[typing.Union[types.InlineKeyboardMarkup,
types.ReplyKeyboardMarkup, types.ReplyKeyboardMarkup,
types.ReplyKeyboardRemove, types.ReplyKeyboardRemove,
types.ForceReply], None] = None,) -> types.Message: types.ForceReply], None] = None,
) -> types.Message:
""" """
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).
@ -459,9 +460,12 @@ class Bot(BaseBot):
Source https://core.telegram.org/bots/api#sendanimation Source https://core.telegram.org/bots/api#sendanimation
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format @channelusername) :param chat_id: Unique identifier for the target chat or username of the target channel
(in the format @channelusername)
:type chat_id: :obj:`typing.Union[base.Integer, base.String]` :type chat_id: :obj:`typing.Union[base.Integer, base.String]`
:param animation: Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. :param animation: Animation to send. Pass a file_id as String to send an animation that exists on the Telegram
servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet,
or upload a new animation using multipart/form-data.
:type animation: :obj:`typing.Union[base.InputFile, base.String]` :type animation: :obj:`typing.Union[base.InputFile, base.String]`
:param duration: Duration of sent animation in seconds :param duration: Duration of sent animation in seconds
:type duration: :obj:`typing.Union[base.Integer, None]` :type duration: :obj:`typing.Union[base.Integer, None]`
@ -469,18 +473,25 @@ class Bot(BaseBot):
:type width: :obj:`typing.Union[base.Integer, None]` :type width: :obj:`typing.Union[base.Integer, None]`
:param height: Animation height :param height: Animation height
:type height: :obj:`typing.Union[base.Integer, None]` :type height: :obj:`typing.Union[base.Integer, None]`
:param thumb: Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnails width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails cant be reused and can be only uploaded as a new file, so you can pass attach://<file_attach_name> if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :param thumb: Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size.
A thumbnails width and height should not exceed 90. Ignored if the file is not uploaded using
multipart/form-data. Thumbnails cant be reused and can be only uploaded as a new file, so you can pass
attach://<file_attach_name> if the thumbnail was uploaded using multipart/form-data under
<file_attach_name>.
:type thumb: :obj:`typing.Union[typing.Union[base.InputFile, base.String], None]` :type thumb: :obj:`typing.Union[typing.Union[base.InputFile, base.String], None]`
:param caption: Animation caption (may also be used when resending animation by file_id), 0-200 characters :param caption: Animation caption (may also be used when resending animation by file_id), 0-200 characters
:type caption: :obj:`typing.Union[base.String, None]` :type caption: :obj:`typing.Union[base.String, None]`
:param parse_mode: Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. :param parse_mode: Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
inline URLs in the media caption.
:type parse_mode: :obj:`typing.Union[base.String, None]` :type parse_mode: :obj:`typing.Union[base.String, None]`
:param disable_notification: Sends the message silently. Users will receive a notification with no sound. :param disable_notification: Sends the message silently. Users will receive a notification with no sound.
:type disable_notification: :obj:`typing.Union[base.Boolean, None]` :type disable_notification: :obj:`typing.Union[base.Boolean, None]`
:param reply_to_message_id: If the message is a reply, ID of the original message :param reply_to_message_id: If the message is a reply, ID of the original message
:type reply_to_message_id: :obj:`typing.Union[base.Integer, None]` :type reply_to_message_id: :obj:`typing.Union[base.Integer, None]`
:param reply_markup: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. :param reply_markup: Additional interface options. A JSON-serialized object for an inline keyboard, custom
:type reply_markup: :obj:`typing.Union[typing.Union[types.InlineKeyboardMarkup, types.ReplyKeyboardMarkup, types.ReplyKeyboardRemove, types.ForceReply], None]` reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
:type reply_markup: :obj:`typing.Union[typing.Union[types.InlineKeyboardMarkup, types.ReplyKeyboardMarkup,
types.ReplyKeyboardRemove, types.ForceReply], None]`
:return: On success, the sent Message is returned. :return: On success, the sent Message is returned.
:rtype: :obj:`types.Message` :rtype: :obj:`types.Message`
""" """
@ -1414,12 +1425,12 @@ class Bot(BaseBot):
return types.Message(**result) return types.Message(**result)
async def edit_message_media(self, async def edit_message_media(self,
media: types.InputMedia, media: types.InputMedia,
chat_id: typing.Union[typing.Union[base.Integer, base.String], None] = None, chat_id: typing.Union[typing.Union[base.Integer, base.String], None] = None,
message_id: typing.Union[base.Integer, None] = None, message_id: typing.Union[base.Integer, None] = None,
inline_message_id: typing.Union[base.String, None] = None, inline_message_id: typing.Union[base.String, None] = None,
reply_markup: typing.Union[types.InlineKeyboardMarkup, None] = None, reply_markup: typing.Union[types.InlineKeyboardMarkup, None] = None,
) -> typing.Union[types.Message, base.Boolean]: ) -> typing.Union[types.Message, base.Boolean]:
""" """
Use this method to edit audio, document, photo, or video messages. Use this method to edit audio, document, photo, or video messages.
If a message is a part of a message album, then it can be edited only to a photo or a video. If a message is a part of a message album, then it can be edited only to a photo or a video.
@ -1442,7 +1453,8 @@ class Bot(BaseBot):
:type media: :obj:`types.InputMedia` :type media: :obj:`types.InputMedia`
:param reply_markup: A JSON-serialized object for a new inline keyboard. :param reply_markup: A JSON-serialized object for a new inline keyboard.
:type reply_markup: :obj:`typing.Union[types.InlineKeyboardMarkup, None]` :type reply_markup: :obj:`typing.Union[types.InlineKeyboardMarkup, None]`
:return: On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned. :return: On success, if the edited message was sent by the bot, the edited Message is returned, otherwise
True is returned.
:rtype: :obj:`typing.Union[types.Message, base.Boolean]` :rtype: :obj:`typing.Union[types.Message, base.Boolean]`
""" """