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 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 # endregion
# region Message sending/editing/deleting # region Message sending/editing/deleting

View File

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

View File

@ -114,22 +114,6 @@ class UpdateMethods(UserMethods):
""" """
return [(callback, event) for event, callback in self._event_builders] 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): async def catch_up(self):
state = self.session.get_update_state(0) state = self.session.get_update_state(0)
if not state or not state.pts: if not state or not state.pts:

View File

@ -163,13 +163,6 @@ class UploadMethods(MessageParseMethods, UserMethods):
return msg 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='', async def _send_album(self, entity, files, caption='',
progress_callback=None, reply_to=None, progress_callback=None, reply_to=None,
parse_mode=utils.Default): parse_mode=utils.Default):

View File

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

View File

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