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

PEP-8 clean-up.

This commit is contained in:
pieter 2015-07-02 23:47:05 +02:00
parent 47ce846ce1
commit 21231a3f01
2 changed files with 4 additions and 1 deletions

View File

@ -7,6 +7,7 @@ API_TOKEN = '<api_token>'
bot = telebot.TeleBot(API_TOKEN) bot = telebot.TeleBot(API_TOKEN)
# Handle '/start' and '/help' # Handle '/start' and '/help'
@bot.message_handler(commands=['help, start']) @bot.message_handler(commands=['help, start'])
def send_welcome(message): def send_welcome(message):
@ -15,6 +16,7 @@ Hi there, I am EchoBot.
I am here to echo your kind words back to you. Just say anything nice and I'll say the exact same thing to you!\ I am here to echo your kind words back to you. Just say anything nice and I'll say the exact same thing to you!\
""") """)
# Handle all other messages with content_type 'text' (content_types defaults to ['text']) # Handle all other messages with content_type 'text' (content_types defaults to ['text'])
@bot.message_handler(func=lambda message: True) @bot.message_handler(func=lambda message: True)
def echo_message(message): def echo_message(message):

View File

@ -290,6 +290,7 @@ class Contact(JsonDeserializable):
phone_number = obj['phone_number'] phone_number = obj['phone_number']
first_name = obj['first_name'] first_name = obj['first_name']
last_name = None last_name = None
user_id = None
if 'last_name' in obj: if 'last_name' in obj:
last_name = obj['last_name'] last_name = obj['last_name']
if 'user_id' in obj: if 'user_id' in obj: