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

Fixing and upgrading next step and reply handlers. + minor fixes

Rename telebot package to pytelegrambotapi becouse lib named telebot exists and it raising many errors

Add methods:
|     register_for_reply_by_message_id,
|     register_next_step_handler_by_chat_id,
|     clear_reply_handlers,
|     clear_reply_handlers_by_message_id
This commit is contained in:
Waffle
2018-04-12 13:45:32 +03:00
parent 373d4d37ff
commit 7957bc45a8
17 changed files with 192 additions and 155 deletions

View File

@@ -4,7 +4,7 @@
# This example shows webhook echo bot with Tornado web framework
# Documenation to Tornado: http://tornadoweb.org
import telebot
import pytelegrambotapi
import tornado.web
import tornado.ioloop
import tornado.httpserver
@@ -27,7 +27,7 @@ WEBHOOK_URL_BASE = "https://{0}:{1}/{2}".format(WEBHOOK_HOST, str(WEBHOOK_PORT),
# When asked for "Common Name (e.g. server FQDN or YOUR name)" you should reply
# with the same value in you put in WEBHOOK_HOST
bot = telebot.TeleBot(API_TOKEN)
bot = pytelegrambotapi.TeleBot(API_TOKEN)
class Root(tornado.web.RequestHandler):
def get(self):
@@ -45,7 +45,7 @@ class webhook_serv(tornado.web.RequestHandler):
# length = int(self.request.headers['Content-Length'])
json_data = self.request.body.decode("utf-8")
update = telebot.types.Update.de_json(json_data)
update = pytelegrambotapi.types.Update.de_json(json_data)
bot.process_new_updates([update])
self.write("")
self.finish()