Remove all deprecated methods

This commit is contained in:
Lonami Exo 2018-06-26 11:01:47 +02:00
parent a43c6c2b68
commit 75dc4809f5
6 changed files with 2 additions and 39 deletions

View File

@ -271,13 +271,6 @@ class MessageMethods(UploadMethods, MessageParseMethods):
return msgs
async def get_message_history(self, *args, **kwargs):
"""Deprecated, see :meth:`get_messages`."""
warnings.warn(
'get_message_history is deprecated, use get_messages instead'
)
return await self.get_messages(*args, **kwargs)
# endregion
# region Message sending/editing/deleting

View File

@ -423,11 +423,6 @@ class TelegramBaseClient(abc.ABC):
"""
raise NotImplementedError
async def invoke(self, *args, **kwargs):
warnings.warn('client.invoke(...) is deprecated, '
'use client(...) instead')
self(*args, **kwargs)
@abc.abstractmethod
def _handle_update(self, update):
raise NotImplementedError

View File

@ -114,22 +114,6 @@ class UpdateMethods(UserMethods):
"""
return [(callback, event) for event, callback in self._event_builders]
def add_update_handler(self, handler):
"""Deprecated, see :meth:`add_event_handler`."""
warnings.warn(
'add_update_handler is deprecated, use the @client.on syntax '
'or add_event_handler(callback, events.Raw) instead (see '
'https://telethon.rtfd.io/en/latest/extra/basic/working-'
'with-updates.html)'
)
return self.add_event_handler(handler, events.Raw)
def remove_update_handler(self, handler):
return self.remove_event_handler(handler)
def list_update_handlers(self):
return [callback for callback, _ in self.list_event_handlers()]
async def catch_up(self):
state = self.session.get_update_state(0)
if not state or not state.pts:

View File

@ -163,13 +163,6 @@ class UploadMethods(MessageParseMethods, UserMethods):
return msg
async def send_voice_note(self, *args, **kwargs):
"""Deprecated, see :meth:`send_file`."""
warnings.warn('send_voice_note is deprecated, use '
'send_file(..., voice_note=True) instead')
kwargs['is_voice_note'] = True
return await self.send_file(*args, **kwargs)
async def _send_album(self, entity, files, caption='',
progress_callback=None, reply_to=None,
parse_mode=utils.Default):

View File

@ -1,10 +1,8 @@
import abc
import itertools
import warnings
from .. import utils
from ..errors import RPCError
from ..tl import TLObject, types, functions
from ..tl import TLObject, types
async def _into_id_set(client, chats):

View File

@ -1,6 +1,6 @@
from .common import EventBuilder, EventCommon, name_inner_event
from .. import utils
from ..tl import types, functions
from ..tl import types
@name_inner_event