1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Merge pull request #1275 from Badiboy/master

chat_invite_link bugfix
This commit is contained in:
Badiboy 2021-08-22 22:17:30 +03:00 committed by GitHub
commit 50e5e96bb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -973,8 +973,8 @@ def create_chat_invite_link(token, chat_id, expire_date, member_limit):
}
if expire_date is not None:
if isinstance(payload['expire_date'], datetime):
payload['expire_date'] = payload['expire_date'].timestamp()
if isinstance(expire_date, datetime):
payload['expire_date'] = expire_date.timestamp()
else:
payload['expire_date'] = expire_date
if member_limit:
@ -991,8 +991,8 @@ def edit_chat_invite_link(token, chat_id, invite_link, expire_date, member_limit
}
if expire_date is not None:
if isinstance(payload['expire_date'], datetime):
payload['expire_date'] = payload['expire_date'].timestamp()
if isinstance(expire_date, datetime):
payload['expire_date'] = expire_date.timestamp()
else:
payload['expire_date'] = expire_date