mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
addded logger info for deprecated funcs
This commit is contained in:
parent
0aa7a8a8f6
commit
0b383498eb
@ -103,7 +103,6 @@ class TeleBot:
|
|||||||
editMessageReplyMarkup
|
editMessageReplyMarkup
|
||||||
editMessageLiveLocation
|
editMessageLiveLocation
|
||||||
stopMessageLiveLocation
|
stopMessageLiveLocation
|
||||||
kickChatMember
|
|
||||||
banChatMember
|
banChatMember
|
||||||
unbanChatMember
|
unbanChatMember
|
||||||
restrictChatMember
|
restrictChatMember
|
||||||
@ -132,7 +131,6 @@ class TeleBot:
|
|||||||
leaveChat
|
leaveChat
|
||||||
getChat
|
getChat
|
||||||
getChatAdministrators
|
getChatAdministrators
|
||||||
getChatMembersCount
|
|
||||||
getChatMemberCount
|
getChatMemberCount
|
||||||
getChatMember
|
getChatMember
|
||||||
answerCallbackQuery
|
answerCallbackQuery
|
||||||
@ -845,7 +843,8 @@ class TeleBot:
|
|||||||
:param chat_id:
|
:param chat_id:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
result = apihelper.get_chat_members_count(self.token, chat_id)
|
logger.info('get_chat_members_count is deprecated. Use get_chat_member_count instead.')
|
||||||
|
result = apihelper.get_chat_member_count(self.token, chat_id)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def get_chat_member_count(self, chat_id: Union[int, str]) -> int:
|
def get_chat_member_count(self, chat_id: Union[int, str]) -> int:
|
||||||
@ -1485,7 +1484,8 @@ class TeleBot:
|
|||||||
Always True for supergroups and channels.
|
Always True for supergroups and channels.
|
||||||
:return: boolean
|
:return: boolean
|
||||||
"""
|
"""
|
||||||
return apihelper.kick_chat_member(self.token, chat_id, user_id, until_date, revoke_messages)
|
logger.info('kick_chat_member is deprecated. Use ban_chat_member instead.')
|
||||||
|
return apihelper.ban_chat_member(self.token, chat_id, user_id, until_date, revoke_messages)
|
||||||
|
|
||||||
def ban_chat_member(
|
def ban_chat_member(
|
||||||
self, chat_id: Union[int, str], user_id: int,
|
self, chat_id: Union[int, str], user_id: int,
|
||||||
@ -2971,7 +2971,8 @@ class AsyncTeleBot(TeleBot):
|
|||||||
|
|
||||||
@util.async_dec()
|
@util.async_dec()
|
||||||
def get_chat_members_count(self, *args):
|
def get_chat_members_count(self, *args):
|
||||||
return TeleBot.get_chat_members_count(self, *args)
|
logger.info('get_chat_members_count is deprecated. Use get_chat_member_count instead')
|
||||||
|
return TeleBot.get_chat_member_count(self, *args)
|
||||||
|
|
||||||
@util.async_dec()
|
@util.async_dec()
|
||||||
def get_chat_member_count(self, *args):
|
def get_chat_member_count(self, *args):
|
||||||
@ -3071,7 +3072,8 @@ class AsyncTeleBot(TeleBot):
|
|||||||
|
|
||||||
@util.async_dec()
|
@util.async_dec()
|
||||||
def kick_chat_member(self, *args, **kwargs):
|
def kick_chat_member(self, *args, **kwargs):
|
||||||
return TeleBot.kick_chat_member(self, *args, **kwargs)
|
logger.info('kick_chat_member is deprecated. Use ban_chat_member instead.')
|
||||||
|
return TeleBot.ban_chat_member(self, *args, **kwargs)
|
||||||
|
|
||||||
@util.async_dec()
|
@util.async_dec()
|
||||||
def ban_chat_member(self, *args, **kwargs):
|
def ban_chat_member(self, *args, **kwargs):
|
||||||
|
@ -330,12 +330,6 @@ def get_chat_administrators(token, chat_id):
|
|||||||
return _make_request(token, method_url, params=payload)
|
return _make_request(token, method_url, params=payload)
|
||||||
|
|
||||||
|
|
||||||
def get_chat_members_count(token, chat_id):
|
|
||||||
method_url = r'getChatMembersCount'
|
|
||||||
payload = {'chat_id': chat_id}
|
|
||||||
return _make_request(token, method_url, params=payload)
|
|
||||||
|
|
||||||
|
|
||||||
def get_chat_member_count(token, chat_id):
|
def get_chat_member_count(token, chat_id):
|
||||||
method_url = r'getChatMemberCount'
|
method_url = r'getChatMemberCount'
|
||||||
payload = {'chat_id': chat_id}
|
payload = {'chat_id': chat_id}
|
||||||
@ -856,18 +850,6 @@ def get_method_by_type(data_type):
|
|||||||
return r'sendSticker'
|
return r'sendSticker'
|
||||||
|
|
||||||
|
|
||||||
def kick_chat_member(token, chat_id, user_id, until_date=None, revoke_messages=None):
|
|
||||||
method_url = 'kickChatMember'
|
|
||||||
payload = {'chat_id': chat_id, 'user_id': user_id}
|
|
||||||
if isinstance(until_date, datetime):
|
|
||||||
payload['until_date'] = until_date.timestamp()
|
|
||||||
else:
|
|
||||||
payload['until_date'] = until_date
|
|
||||||
if revoke_messages is not None:
|
|
||||||
payload['revoke_messages'] = revoke_messages
|
|
||||||
return _make_request(token, method_url, params=payload, method='post')
|
|
||||||
|
|
||||||
|
|
||||||
def ban_chat_member(token, chat_id, user_id, until_date=None, revoke_messages=None):
|
def ban_chat_member(token, chat_id, user_id, until_date=None, revoke_messages=None):
|
||||||
method_url = 'banChatMember'
|
method_url = 'banChatMember'
|
||||||
payload = {'chat_id': chat_id, 'user_id': user_id}
|
payload = {'chat_id': chat_id, 'user_id': user_id}
|
||||||
|
Loading…
Reference in New Issue
Block a user