Fix "invite link must be non-empty" error

`bot.edit_chat_invite_link` method contained a mistake: `invite_link` and `name` were supposed to be vice-versa in `apihelper.edit_chat_invite_link(...)` call. This caused to be invite_link empty or contain invalid value, resulting to get `Bad Request: invite link must be non-empty` error.
This also affected the async version.
This commit is contained in:
Albert 2023-01-21 17:00:36 +04:00
parent b743aa5813
commit 5e0da40fcd
2 changed files with 2 additions and 2 deletions

View File

@ -3224,7 +3224,7 @@ class TeleBot:
:rtype: :class:`telebot.types.ChatInviteLink`
"""
return types.ChatInviteLink.de_json(
apihelper.edit_chat_invite_link(self.token, chat_id, name, invite_link, expire_date, member_limit, creates_join_request)
apihelper.edit_chat_invite_link(self.token, chat_id, invite_link, name, expire_date, member_limit, creates_join_request)
)
def revoke_chat_invite_link(

View File

@ -4084,7 +4084,7 @@ class AsyncTeleBot:
:rtype: :class:`telebot.types.ChatInviteLink`
"""
return types.ChatInviteLink.de_json(
await asyncio_helper.edit_chat_invite_link(self.token, chat_id, name, invite_link, expire_date, member_limit, creates_join_request)
await asyncio_helper.edit_chat_invite_link(self.token, chat_id, invite_link, name, expire_date, member_limit, creates_join_request)
)
async def revoke_chat_invite_link(