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:
@@ -9,7 +9,7 @@ import ssl
|
||||
|
||||
from aiohttp import web
|
||||
|
||||
import telebot
|
||||
import pytelegrambotapi
|
||||
|
||||
|
||||
API_TOKEN = '<api_token>'
|
||||
@@ -33,10 +33,10 @@ WEBHOOK_URL_BASE = "https://{}:{}".format(WEBHOOK_HOST, WEBHOOK_PORT)
|
||||
WEBHOOK_URL_PATH = "/{}/".format(API_TOKEN)
|
||||
|
||||
|
||||
logger = telebot.logger
|
||||
telebot.logger.setLevel(logging.INFO)
|
||||
logger = pytelegrambotapi.logger
|
||||
pytelegrambotapi.logger.setLevel(logging.INFO)
|
||||
|
||||
bot = telebot.TeleBot(API_TOKEN)
|
||||
bot = pytelegrambotapi.TeleBot(API_TOKEN)
|
||||
|
||||
app = web.Application()
|
||||
|
||||
@@ -45,7 +45,7 @@ app = web.Application()
|
||||
async def handle(request):
|
||||
if request.match_info.get('token') == bot.token:
|
||||
request_body_dict = await request.json()
|
||||
update = telebot.types.Update.de_json(request_body_dict)
|
||||
update = pytelegrambotapi.types.Update.de_json(request_body_dict)
|
||||
bot.process_new_updates([update])
|
||||
return web.Response()
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user