Skip to content

Commit 86ff673

Browse files
committed
Fixed issues from PR python-telegram-bot#1166
1 parent 33df3a8 commit 86ff673

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

telegram/bot.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,12 +1093,12 @@ def send_contact(self,
10931093
phone_number=None,
10941094
first_name=None,
10951095
last_name=None,
1096-
vcard=None,
10971096
disable_notification=False,
10981097
reply_to_message_id=None,
10991098
reply_markup=None,
11001099
timeout=None,
11011100
contact=None,
1101+
vcard=None,
11021102
**kwargs):
11031103
"""Use this method to send phone contacts.
11041104
@@ -1143,8 +1143,10 @@ def send_contact(self,
11431143
if isinstance(contact, Contact):
11441144
phone_number = contact.phone_number
11451145
first_name = contact.first_name
1146-
last_name = contact.last_name
1147-
vcard = contact.vcard
1146+
if contact.last_name:
1147+
last_name = contact.last_name
1148+
if contact.vcard:
1149+
vcard = contact.vcard
11481150

11491151
data = {'chat_id': chat_id, 'phone_number': phone_number, 'first_name': first_name}
11501152

telegram/inline/inlinequeryresultcontact.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ def __init__(self,
6666
phone_number,
6767
first_name,
6868
last_name=None,
69-
vcard=None,
7069
reply_markup=None,
7170
input_message_content=None,
7271
thumb_url=None,
7372
thumb_width=None,
7473
thumb_height=None,
74+
vcard=None,
7575
**kwargs):
7676
# Required
7777
super(InlineQueryResultContact, self).__init__('contact', id)

0 commit comments

Comments
 (0)