mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
ref: style fixes
This commit is contained in:
parent
608d908bc8
commit
fe733c05ab
8 changed files with 12 additions and 13 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -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`
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ from datetime import datetime
|
|||
|
||||
from . import base
|
||||
from . import fields
|
||||
from .user import User
|
||||
|
||||
|
||||
class VoiceChatScheduled(base.TelegramObject):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue