Проблема telegram.ext.dispatcher - ERROR - No error handlers are registered, logging exception
run.py
from telegram.ext import CommandHandler
from telegram.ext import Updater
from handler import commands
from config import TG_TOKEN, TG_API_URL
import logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
def bot_run():
updater = Updater(token=TG_TOKEN, base_url=TG_API_URL, use_context=True)
dispatcher = updater.dispatcher
start_handler = CommandHandler('start', commands)
dispatcher.add_handler(start_handler)
updater.start_polling()
updater.idle()
if __name__ == '__main__':
bot_run()
commands.py
from telegram import Update
from telegram.ext import CallbackContext
from logger import logger_check_func
def start(update: Update, context: CallbackContext):
context.bot.send_message(chat_id=update.message.chat_id, text="Welcome!")
Ошибка
2020-09-13 18:33:48,459 - telegram.ext.dispatcher - ERROR - No error handlers are registered, logging exception.
Traceback (most recent call last):
File "E:\Python3\telegram-bot\venv\lib\site-packages\telegram\ext\dispatcher.py", line 390, in process_update
handler.handle_update(update, self, check, context)
File "E:\Python3\telegram-bot\venv\lib\site-packages\telegram\ext\handler.py", line 117, in handle_update
return self.callback(update, context)
TypeError: 'module' object is not callable
В Bot Father я тоже добавил команду /start . Не помогло(
Ответы (1 шт):
Автор решения: YDC developer
→ Ссылка
новичок Я тебе дам совет, поможет - Используй лучше pytelegramBotAPI (telebot) или aiogram. Это будет легче, и больше функций будет в боте