ref: style fixes

This commit is contained in:
uburuntu 2021-07-28 19:56:11 +03:00
parent 608d908bc8
commit fe733c05ab
No known key found for this signature in database
GPG key ID: 59E643252F903BE1
8 changed files with 12 additions and 13 deletions

View file

@ -4,7 +4,7 @@ import typing
import warnings
from contextvars import ContextVar
from dataclasses import dataclass, field
from typing import Any, Dict, Iterable, List, Optional, Union
from typing import Any, Dict, Iterable, Optional, Union
from babel.support import LazyProxy

View file

@ -78,7 +78,7 @@ class TelegramObject(ContextInstanceMixin, metaclass=MetaTelegramObject):
Abstract class for telegram objects
"""
def __init__(self, conf: typing.Dict[str, typing.Any]=None, **kwargs: typing.Any) -> None:
def __init__(self, conf: typing.Dict[str, typing.Any] = None, **kwargs: typing.Any) -> None:
"""
Deserialize object

View file

@ -12,4 +12,4 @@ class BotCommand(base.TelegramObject):
description: base.String = fields.Field()
def __init__(self, command: base.String, description: base.String):
super(BotCommand, self).__init__(command=command, description=description)
super(BotCommand, self).__init__(command=command, description=description)

View file

@ -3039,10 +3039,10 @@ class ContentType(helper.Helper):
GROUP_CHAT_CREATED = helper.Item() # group_chat_created
PASSPORT_DATA = helper.Item() # passport_data
PROXIMITY_ALERT_TRIGGERED = helper.Item() # proximity_alert_triggered
VOICE_CHAT_SCHEDULED = helper.Item() # voice_chat_scheduled
VOICE_CHAT_STARTED = helper.Item() # voice_chat_started
VOICE_CHAT_ENDED = helper.Item() # voice_chat_ended
VOICE_CHAT_PARTICIPANTS_INVITED = helper.Item() # voice_chat_participants_invited
VOICE_CHAT_SCHEDULED = helper.Item() # voice_chat_scheduled
VOICE_CHAT_STARTED = helper.Item() # voice_chat_started
VOICE_CHAT_ENDED = helper.Item() # voice_chat_ended
VOICE_CHAT_PARTICIPANTS_INVITED = helper.Item() # voice_chat_participants_invited
UNKNOWN = helper.Item() # unknown
ANY = helper.Item() # any

View file

@ -48,12 +48,12 @@ class MessageEntity(base.TelegramObject):
:return: part of text
"""
if sys.maxunicode == 0xFFFF:
return text[self.offset : self.offset + self.length]
return text[self.offset: self.offset + self.length]
entity_text = (
text.encode("utf-16-le") if not isinstance(text, bytes) else text
)
entity_text = entity_text[self.offset * 2 : (self.offset + self.length) * 2]
entity_text = entity_text[self.offset * 2: (self.offset + self.length) * 2]
return entity_text.decode("utf-16-le")
@deprecated(

View file

@ -129,7 +129,9 @@ class KeyboardButton(base.TelegramObject):
class ReplyKeyboardRemove(base.TelegramObject):
"""
Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup).
Upon receiving a message with this object, Telegram clients will remove the current custom keyboard
and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot.
An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup).
https://core.telegram.org/bots/api#replykeyboardremove
"""

View file

@ -41,8 +41,6 @@ class Sticker(base.TelegramObject, mixins.Downloadable):
Source: https://core.telegram.org/bots/api#deletestickerfromset
:param sticker: File identifier of the sticker
:type sticker: :obj:`base.String`
:return: Returns True on success
:rtype: :obj:`base.Boolean`
"""

View file

@ -2,7 +2,6 @@ from datetime import datetime
from . import base
from . import fields
from .user import User
class VoiceChatScheduled(base.TelegramObject):