fix: silent update

Special thanks for @levlam for silent Telegram API updates with removing fields.
This commit is contained in:
Oleg A 2021-12-08 21:36:12 +03:00
parent 910e4d7784
commit 01ae01661d

View file

@ -1818,14 +1818,11 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin):
self,
chat_id: typing.Union[base.Integer, base.String],
sender_chat_id: base.Integer,
until_date: typing.Union[
base.Integer, datetime.datetime, datetime.timedelta, None
] = None,
):
"""Ban a channel chat in a supergroup or a channel.
The owner of the chat will not be able to send messages and join
live streams on behalf of the chat, unless it is unbanned first.
Until the chat is unbanned, the owner of the banned chat won't
be able to send messages on behalf of any of their channels.
The bot must be an administrator in the supergroup or channel
for this to work and must have the appropriate administrator
rights. Returns True on success.
@ -1837,12 +1834,7 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin):
@channelusername)
:param sender_chat_id: Unique identifier of the target sender
chat
:param until_date: Date when the sender chat will be unbanned,
unix time. If the chat is banned for more than 366 days or
less than 30 seconds from the current time they are
considered to be banned forever.
"""
until_date = prepare_arg(until_date)
payload = generate_payload(**locals())
return await self.request(api.Methods.BAN_CHAT_SENDER_CHAT, payload)