From 21231a3f011e7563f926621accd0c329e42824e6 Mon Sep 17 00:00:00 2001 From: pieter Date: Thu, 2 Jul 2015 23:47:05 +0200 Subject: [PATCH] PEP-8 clean-up. --- examples/echo_bot.py | 4 +++- telebot/types.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/echo_bot.py b/examples/echo_bot.py index 7a3f93d..d3538a8 100644 --- a/examples/echo_bot.py +++ b/examples/echo_bot.py @@ -7,6 +7,7 @@ API_TOKEN = '' bot = telebot.TeleBot(API_TOKEN) + # Handle '/start' and '/help' @bot.message_handler(commands=['help, start']) 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!\ """) + # Handle all other messages with content_type 'text' (content_types defaults to ['text']) @bot.message_handler(func=lambda message: True) def echo_message(message): @@ -23,4 +25,4 @@ def echo_message(message): bot.polling() while True: - pass \ No newline at end of file + pass diff --git a/telebot/types.py b/telebot/types.py index c3c9d90..7056a77 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -290,6 +290,7 @@ class Contact(JsonDeserializable): phone_number = obj['phone_number'] first_name = obj['first_name'] last_name = None + user_id = None if 'last_name' in obj: last_name = obj['last_name'] if 'user_id' in obj: