aekondratiev / redmine_telegram_email

Messages to the Telegram, like email, from Redmine.
17 stars 5 forks source link

telegram.ext.dispatcher - ERROR - An uncaught error was raised while handling the error. #13

Open avpchillout opened 2 years ago

avpchillout commented 2 years ago

Добрый день! Подскажите, в чём может быть проблема? Как я понимаю, в новых версиях телеграм бота изменили синтаксис или вообще что-то убрали, но.. в общем, прошу помощи, как заставить это работать :)

root@avp-redmine:/opt/redmine/plugins/redmine_telegram_email# python3 bot.py 2022-03-01 12:31:59,570 - apscheduler.scheduler - INFO - Scheduler started 2022-03-01 12:49:39,150 - telegram.ext.dispatcher - ERROR - An uncaught error was raised while handling the error. Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/telegram/ext/dispatcher.py", line 555, in process_update handler.handle_update(update, self, check, context) File "/usr/local/lib/python3.8/dist-packages/telegram/ext/handler.py", line 198, in handle_update return self.callback(update, context) File "bot.py", line 30, in start update.message.reply_text('Set this number ' + str(update.message.chat_id) + ' to your redmine account /my/account into Telegram Channel') AttributeError: 'CallbackContext' object has no attribute 'message'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/telegram/ext/dispatcher.py", line 567, in process_update self.dispatch_error(update, exc) File "/usr/local/lib/python3.8/dist-packages/telegram/ext/dispatcher.py", line 810, in dispatch_error callback(update, context) TypeError: error() missing 1 required positional argument: 'error'

Environment: Redmine version 4.2.3.stable Ruby version 2.7.0-p0 (2019-12-25) [x86_64-linux-gnu] Rails version 5.2.6 Environment production Database adapter PostgreSQL Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery smtp SCM: Git 2.25.1 Filesystem
Redmine plugins: redmine_telegram_email 0.3 redmine_theme_changer 0.4.0

root@avp-redmine:/opt/redmine# python3 -m telegram python-telegram-bot 13.11 Bot API 5.7 certifi 2019.11.28 Python 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]

avpchillout commented 2 years ago

С этой проблемой я разобрался, бот же всего лишь для получения chat id - получил другим методом. Но плагин всё равно не отправляет сообщения, токен верный, поля создал, у себя в поле id чата указал.. email уведомления у меня в конфиге не настроены, но вроде влиять не должны. debug = 1 сделал, но куда пишутся логи пока не нашёл, бот тоже ничего не присылает.