From 1bf8b9da09fc6c4d71a1a7886b3705815e1874fd Mon Sep 17 00:00:00 2001 From: eternnoir Date: Fri, 26 Jun 2015 18:11:11 +0800 Subject: [PATCH] Update readme. --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7449fc9..439af8d 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,18 @@ print tb.send_message(281281, 'gogo power ranger') * Echo Bot ```python -mport telebot +import telebot import time -TOKEN = '' +TOKEN = '' def listener(*messages): + """ + When new message get will call this function. + :param messages: + :return: + """ for m in messages: chatid = m.chat.id text = m.text @@ -33,7 +38,7 @@ def listener(*messages): tb = telebot.TeleBot(TOKEN) tb.get_update() # cache exist message -tb.set_update_listener(listener) +tb.set_update_listener(listener) #register listener tb.polling(3) while True: time.sleep(20)