-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Description
Steps to reproduce
- Create InlineQueryHandler
- Create inline request to bot
- [InlineQueryResultDocument(
id=uuid4(), document_url='fill with any pdf url', caption='Test', mime_type='application/pdf', reply_markup=None
)] as the results - Send the result using update.inline_query.answer
Expected behaviour
Nothing raised and worked fine on python-telegram-bot==12.3.0.
Actual behaviour
Raise AttributeError: 'NoneType' object has no attribute 'parse_mode'
Configuration
Operating System: WSL2 Ubuntu
python, python-telegram-bot & dependencies:
python3+
python-telegram-bot=12.4.1
$ python -m telegram
Logs
telegram.ext.dispatcher - ERROR - An error was raised while processing the update and an uncaught error was raised while handling the error with an error_handler
Traceback (most recent call last):
File "/mnt/d/Projects/bot/env/lib/python3.6/site-packages/telegram/ext/dispatcher.py", line 403, in process_update
self.dispatch_error(update, e)
File "/mnt/d/Projects/bot/env/lib/python3.6/site-packages/telegram/ext/dispatcher.py", line 528, in dispatch_error
callback(update, CallbackContext.from_error(update, error, self))
File "/mnt/d/Projects/bot/handler/error/init.py", line 55, in error
raise context.error
File "/mnt/d/Projects/bot/env/lib/python3.6/site-packages/telegram/ext/dispatcher.py", line 390, in process_update
handler.handle_update(update, self, check, context)
File "/mnt/d/Projects/bot/env/lib/python3.6/site-packages/telegram/ext/handler.py", line 117, in handle_update
return self.callback(update, context)
File "/mnt/d/Projects/bot/handler/inline/init.py", line 53, in query
context,
File "/mnt/d/Projects/bot/libs/decorators.py", line 38, in wrapped
return func(self, update, context, *args, **kwargs)
File "/mnt/d/Projects/bot/handler/inline/pdf.py", line 26, in answer
results=results_list,
File "/mnt/d/Projects/bot/env/lib/python3.6/site-packages/telegram/inline/inlinequery.py", line 103, in answer
return self.bot.answer_inline_query(self.id, *args, **kwargs)
File "</mnt/d/Projects/bot/env/lib/python3.6/site-packages/decorator.py:decorator-gen-21>", line 2, in answer_inline_query
File "/mnt/d/Projects/bot/env/lib/python3.6/site-packages/telegram/bot.py", line 67, in decorator
result = func(*args, **kwargs)
File "/mnt/d/Projects/bot/env/lib/python3.6/site-packages/telegram/bot.py", line 1515, in answer_inline_query
res.parse_mode = self.defaults.parse_mode
AttributeError: 'NoneType' object has no attribute 'parse_mode'